mirror of
https://github.com/directorz/mailfull-go.git
synced 2025-12-20 19:17:02 +00:00
Add a option to subcommands #7
This commit is contained in:
@@ -20,7 +20,7 @@ func (c *AliasDomainAddCommand) Synopsis() string {
|
|||||||
func (c *AliasDomainAddCommand) Help() string {
|
func (c *AliasDomainAddCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain target
|
%s %s [-n] domain target
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -30,6 +30,10 @@ Required Args:
|
|||||||
The domain name that you want to create.
|
The domain name that you want to create.
|
||||||
target
|
target
|
||||||
The target domain name.
|
The target domain name.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -39,6 +43,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *AliasDomainAddCommand) Run(args []string) int {
|
func (c *AliasDomainAddCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 2 {
|
if len(args) != 2 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -64,6 +74,10 @@ func (c *AliasDomainAddCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (c *AliasDomainDelCommand) Synopsis() string {
|
|||||||
func (c *AliasDomainDelCommand) Help() string {
|
func (c *AliasDomainDelCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain
|
%s %s [-n] domain
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -28,6 +28,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
domain
|
domain
|
||||||
The domain name that you want to delete.
|
The domain name that you want to delete.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -37,6 +41,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *AliasDomainDelCommand) Run(args []string) int {
|
func (c *AliasDomainDelCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -55,6 +65,10 @@ func (c *AliasDomainDelCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (c *AliasUserAddCommand) Synopsis() string {
|
|||||||
func (c *AliasUserAddCommand) Help() string {
|
func (c *AliasUserAddCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s address target [target...]
|
%s %s [-n] address target [target...]
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -31,6 +31,10 @@ Required Args:
|
|||||||
The email address that you want to create.
|
The email address that you want to create.
|
||||||
target
|
target
|
||||||
Target email addresses.
|
Target email addresses.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -40,6 +44,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *AliasUserAddCommand) Run(args []string) int {
|
func (c *AliasUserAddCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) < 2 {
|
if len(args) < 2 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -73,6 +83,10 @@ func (c *AliasUserAddCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (c *AliasUserDelCommand) Synopsis() string {
|
|||||||
func (c *AliasUserDelCommand) Help() string {
|
func (c *AliasUserDelCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s address
|
%s %s [-n] address
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -29,6 +29,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
address
|
address
|
||||||
The email address that you want to delete.
|
The email address that you want to delete.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -38,6 +42,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *AliasUserDelCommand) Run(args []string) int {
|
func (c *AliasUserDelCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -63,6 +73,10 @@ func (c *AliasUserDelCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (c *AliasUserModCommand) Synopsis() string {
|
|||||||
func (c *AliasUserModCommand) Help() string {
|
func (c *AliasUserModCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s address target [target...]
|
%s %s [-n] address target [target...]
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -31,6 +31,10 @@ Required Args:
|
|||||||
The email address that you want to modify.
|
The email address that you want to modify.
|
||||||
target
|
target
|
||||||
Target email addresses.
|
Target email addresses.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -40,6 +44,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *AliasUserModCommand) Run(args []string) int {
|
func (c *AliasUserModCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) < 2 {
|
if len(args) < 2 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -82,6 +92,10 @@ func (c *AliasUserModCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (c *CatchAllSetCommand) Synopsis() string {
|
|||||||
func (c *CatchAllSetCommand) Help() string {
|
func (c *CatchAllSetCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain user
|
%s %s [-n] domain user
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -30,6 +30,10 @@ Required Args:
|
|||||||
The domain name.
|
The domain name.
|
||||||
user
|
user
|
||||||
The user name that you want to set as catchall user.
|
The user name that you want to set as catchall user.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -39,6 +43,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *CatchAllSetCommand) Run(args []string) int {
|
func (c *CatchAllSetCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 2 {
|
if len(args) != 2 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -64,6 +74,10 @@ func (c *CatchAllSetCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (c *CatchAllUnsetCommand) Synopsis() string {
|
|||||||
func (c *CatchAllUnsetCommand) Help() string {
|
func (c *CatchAllUnsetCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain
|
%s %s [-n] domain
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -28,6 +28,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
domain
|
domain
|
||||||
The domain name.
|
The domain name.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -37,6 +41,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *CatchAllUnsetCommand) Run(args []string) int {
|
func (c *CatchAllUnsetCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -55,6 +65,10 @@ func (c *CatchAllUnsetCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (c *DomainAddCommand) Synopsis() string {
|
|||||||
func (c *DomainAddCommand) Help() string {
|
func (c *DomainAddCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain
|
%s %s [-n] domain
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -28,6 +28,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
domain
|
domain
|
||||||
The domain name that you want to create.
|
The domain name that you want to create.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -37,6 +41,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *DomainAddCommand) Run(args []string) int {
|
func (c *DomainAddCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -72,6 +82,10 @@ func (c *DomainAddCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (c *DomainDelCommand) Synopsis() string {
|
|||||||
func (c *DomainDelCommand) Help() string {
|
func (c *DomainDelCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain
|
%s %s [-n] domain
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -28,6 +28,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
domain
|
domain
|
||||||
The domain name that you want to delete.
|
The domain name that you want to delete.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -37,6 +41,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *DomainDelCommand) Run(args []string) int {
|
func (c *DomainDelCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -55,6 +65,10 @@ func (c *DomainDelCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (c *DomainDisableCommand) Synopsis() string {
|
|||||||
func (c *DomainDisableCommand) Help() string {
|
func (c *DomainDisableCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain
|
%s %s [-n] domain
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -28,6 +28,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
domain
|
domain
|
||||||
The domain name that you want to disable.
|
The domain name that you want to disable.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -37,6 +41,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *DomainDisableCommand) Run(args []string) int {
|
func (c *DomainDisableCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -67,6 +77,10 @@ func (c *DomainDisableCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (c *DomainEnableCommand) Synopsis() string {
|
|||||||
func (c *DomainEnableCommand) Help() string {
|
func (c *DomainEnableCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s domain
|
%s %s [-n] domain
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -28,6 +28,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
domain
|
domain
|
||||||
The domain name that you want to enable.
|
The domain name that you want to enable.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -37,6 +41,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *DomainEnableCommand) Run(args []string) int {
|
func (c *DomainEnableCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -67,6 +77,10 @@ func (c *DomainEnableCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (c *UserAddCommand) Synopsis() string {
|
|||||||
func (c *UserAddCommand) Help() string {
|
func (c *UserAddCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s address
|
%s %s [-n] address
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -29,6 +29,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
address
|
address
|
||||||
The email address that you want to create.
|
The email address that you want to create.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -38,6 +42,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *UserAddCommand) Run(args []string) int {
|
func (c *UserAddCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -70,6 +80,10 @@ func (c *UserAddCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Required Args:
|
|||||||
Optional Args:
|
Optional Args:
|
||||||
password
|
password
|
||||||
Specify the password instead of your typing.
|
Specify the password instead of your typing.
|
||||||
This option is not recommended because the password will be visible in your shell history.
|
This option is NOT recommended because the password will be visible in your shell history.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (c *UserDelCommand) Synopsis() string {
|
|||||||
func (c *UserDelCommand) Help() string {
|
func (c *UserDelCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s address
|
%s %s [-n] address
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -29,6 +29,10 @@ Description:
|
|||||||
Required Args:
|
Required Args:
|
||||||
address
|
address
|
||||||
The email address that you want to delete.
|
The email address that you want to delete.
|
||||||
|
|
||||||
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -38,6 +42,12 @@ Required Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *UserDelCommand) Run(args []string) int {
|
func (c *UserDelCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -69,6 +79,10 @@ func (c *UserDelCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func (c *UserPasswdCommand) Synopsis() string {
|
|||||||
func (c *UserPasswdCommand) Help() string {
|
func (c *UserPasswdCommand) Help() string {
|
||||||
txt := fmt.Sprintf(`
|
txt := fmt.Sprintf(`
|
||||||
Usage:
|
Usage:
|
||||||
%s %s address [password]
|
%s %s [-n] address [password]
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
%s
|
%s
|
||||||
@@ -32,9 +32,11 @@ Required Args:
|
|||||||
The email address that you want to update the password.
|
The email address that you want to update the password.
|
||||||
|
|
||||||
Optional Args:
|
Optional Args:
|
||||||
|
-n
|
||||||
|
Don't update databases.
|
||||||
password
|
password
|
||||||
Specify the password instead of your typing.
|
Specify the password instead of your typing.
|
||||||
This option is not recommended because the password will be visible in your shell history.
|
This option is NOT recommended because the password will be visible in your shell history.
|
||||||
`,
|
`,
|
||||||
c.CmdName, c.SubCmdName,
|
c.CmdName, c.SubCmdName,
|
||||||
c.Synopsis())
|
c.Synopsis())
|
||||||
@@ -44,6 +46,12 @@ Optional Args:
|
|||||||
|
|
||||||
// Run runs the command and returns the exit status.
|
// Run runs the command and returns the exit status.
|
||||||
func (c *UserPasswdCommand) Run(args []string) int {
|
func (c *UserPasswdCommand) Run(args []string) int {
|
||||||
|
noCommit, err := noCommitFlag(&args)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) != 1 && len(args) != 2 {
|
if len(args) != 1 && len(args) != 2 {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help())
|
||||||
return 1
|
return 1
|
||||||
@@ -115,6 +123,10 @@ func (c *UserPasswdCommand) Run(args []string) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if noCommit {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
mailData, err := repo.MailData()
|
mailData, err := repo.MailData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user