diff --git a/cmd/mailfull/aliasdomainadd.go b/cmd/mailfull/cmd_aliasdomainadd.go similarity index 85% rename from cmd/mailfull/aliasdomainadd.go rename to cmd/mailfull/cmd_aliasdomainadd.go index 5cec85b..1310c1e 100644 --- a/cmd/mailfull/aliasdomainadd.go +++ b/cmd/mailfull/cmd_aliasdomainadd.go @@ -6,18 +6,18 @@ import ( mailfull "github.com/directorz/mailfull-go" ) -// AliasDomainAddCommand represents a AliasDomainAddCommand. -type AliasDomainAddCommand struct { +// CmdAliasDomainAdd represents a CmdAliasDomainAdd. +type CmdAliasDomainAdd struct { Meta } // Synopsis returns a one-line synopsis. -func (c *AliasDomainAddCommand) Synopsis() string { +func (c *CmdAliasDomainAdd) Synopsis() string { return "Create a new aliasdomain." } // Help returns long-form help text. -func (c *AliasDomainAddCommand) Help() string { +func (c *CmdAliasDomainAdd) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain target @@ -42,7 +42,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *AliasDomainAddCommand) Run(args []string) int { +func (c *CmdAliasDomainAdd) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/aliasdomaindel.go b/cmd/mailfull/cmd_aliasdomaindel.go similarity index 83% rename from cmd/mailfull/aliasdomaindel.go rename to cmd/mailfull/cmd_aliasdomaindel.go index c38f42f..a20635d 100644 --- a/cmd/mailfull/aliasdomaindel.go +++ b/cmd/mailfull/cmd_aliasdomaindel.go @@ -6,18 +6,18 @@ import ( mailfull "github.com/directorz/mailfull-go" ) -// AliasDomainDelCommand represents a AliasDomainDelCommand. -type AliasDomainDelCommand struct { +// CmdAliasDomainDel represents a CmdAliasDomainDel. +type CmdAliasDomainDel struct { Meta } // Synopsis returns a one-line synopsis. -func (c *AliasDomainDelCommand) Synopsis() string { +func (c *CmdAliasDomainDel) Synopsis() string { return "Delete a aliasdomain." } // Help returns long-form help text. -func (c *AliasDomainDelCommand) Help() string { +func (c *CmdAliasDomainDel) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain @@ -40,7 +40,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *AliasDomainDelCommand) Run(args []string) int { +func (c *CmdAliasDomainDel) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/aliasdomains.go b/cmd/mailfull/cmd_aliasdomains.go similarity index 83% rename from cmd/mailfull/aliasdomains.go rename to cmd/mailfull/cmd_aliasdomains.go index bdc8856..30f41f2 100644 --- a/cmd/mailfull/aliasdomains.go +++ b/cmd/mailfull/cmd_aliasdomains.go @@ -7,18 +7,18 @@ import ( mailfull "github.com/directorz/mailfull-go" ) -// AliasDomainsCommand represents a AliasDomainsCommand. -type AliasDomainsCommand struct { +// CmdAliasDomains represents a CmdAliasDomains. +type CmdAliasDomains struct { Meta } // Synopsis returns a one-line synopsis. -func (c *AliasDomainsCommand) Synopsis() string { +func (c *CmdAliasDomains) Synopsis() string { return "Show aliasdomains." } // Help returns long-form help text. -func (c *AliasDomainsCommand) Help() string { +func (c *CmdAliasDomains) Help() string { txt := fmt.Sprintf(` Usage: %s %s [domain] @@ -37,7 +37,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *AliasDomainsCommand) Run(args []string) int { +func (c *CmdAliasDomains) Run(args []string) int { if len(args) > 1 { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) return 1 diff --git a/cmd/mailfull/aliasuseradd.go b/cmd/mailfull/cmd_aliasuseradd.go similarity index 87% rename from cmd/mailfull/aliasuseradd.go rename to cmd/mailfull/cmd_aliasuseradd.go index 4cc004c..aaf83a1 100644 --- a/cmd/mailfull/aliasuseradd.go +++ b/cmd/mailfull/cmd_aliasuseradd.go @@ -7,18 +7,18 @@ import ( mailfull "github.com/directorz/mailfull-go" ) -// AliasUserAddCommand represents a AliasUserAddCommand. -type AliasUserAddCommand struct { +// CmdAliasUserAdd represents a CmdAliasUserAdd. +type CmdAliasUserAdd struct { Meta } // Synopsis returns a one-line synopsis. -func (c *AliasUserAddCommand) Synopsis() string { +func (c *CmdAliasUserAdd) Synopsis() string { return "Create a new aliasuser." } // Help returns long-form help text. -func (c *AliasUserAddCommand) Help() string { +func (c *CmdAliasUserAdd) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] address target [target...] @@ -43,7 +43,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *AliasUserAddCommand) Run(args []string) int { +func (c *CmdAliasUserAdd) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/aliasuserdel.go b/cmd/mailfull/cmd_aliasuserdel.go similarity index 85% rename from cmd/mailfull/aliasuserdel.go rename to cmd/mailfull/cmd_aliasuserdel.go index 8c628cd..45b172b 100644 --- a/cmd/mailfull/aliasuserdel.go +++ b/cmd/mailfull/cmd_aliasuserdel.go @@ -7,18 +7,18 @@ import ( mailfull "github.com/directorz/mailfull-go" ) -// AliasUserDelCommand represents a AliasUserDelCommand. -type AliasUserDelCommand struct { +// CmdAliasUserDel represents a CmdAliasUserDel. +type CmdAliasUserDel struct { Meta } // Synopsis returns a one-line synopsis. -func (c *AliasUserDelCommand) Synopsis() string { +func (c *CmdAliasUserDel) Synopsis() string { return "Delete a aliasuser." } // Help returns long-form help text. -func (c *AliasUserDelCommand) Help() string { +func (c *CmdAliasUserDel) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] address @@ -41,7 +41,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *AliasUserDelCommand) Run(args []string) int { +func (c *CmdAliasUserDel) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/aliasusermod.go b/cmd/mailfull/cmd_aliasusermod.go similarity index 88% rename from cmd/mailfull/aliasusermod.go rename to cmd/mailfull/cmd_aliasusermod.go index 793b063..95e8932 100644 --- a/cmd/mailfull/aliasusermod.go +++ b/cmd/mailfull/cmd_aliasusermod.go @@ -7,18 +7,18 @@ import ( mailfull "github.com/directorz/mailfull-go" ) -// AliasUserModCommand represents a AliasUserModCommand. -type AliasUserModCommand struct { +// CmdAliasUserMod represents a CmdAliasUserMod. +type CmdAliasUserMod struct { Meta } // Synopsis returns a one-line synopsis. -func (c *AliasUserModCommand) Synopsis() string { +func (c *CmdAliasUserMod) Synopsis() string { return "Modify a aliasuser." } // Help returns long-form help text. -func (c *AliasUserModCommand) Help() string { +func (c *CmdAliasUserMod) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] address target [target...] @@ -43,7 +43,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *AliasUserModCommand) Run(args []string) int { +func (c *CmdAliasUserMod) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/aliasusers.go b/cmd/mailfull/cmd_aliasusers.go similarity index 80% rename from cmd/mailfull/aliasusers.go rename to cmd/mailfull/cmd_aliasusers.go index c2db6ff..c43a7f0 100644 --- a/cmd/mailfull/aliasusers.go +++ b/cmd/mailfull/cmd_aliasusers.go @@ -7,18 +7,18 @@ import ( "github.com/directorz/mailfull-go" ) -// AliasUsersCommand represents a AliasUsersCommand. -type AliasUsersCommand struct { +// CmdAliasUsers represents a CmdAliasUsers. +type CmdAliasUsers struct { Meta } // Synopsis returns a one-line synopsis. -func (c *AliasUsersCommand) Synopsis() string { +func (c *CmdAliasUsers) Synopsis() string { return "Show aliasusers." } // Help returns long-form help text. -func (c *AliasUsersCommand) Help() string { +func (c *CmdAliasUsers) Help() string { txt := fmt.Sprintf(` Usage: %s %s domain @@ -37,7 +37,7 @@ Required Args: } // Run runs the command and returns the exit status. -func (c *AliasUsersCommand) Run(args []string) int { +func (c *CmdAliasUsers) Run(args []string) int { if len(args) != 1 { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) return 1 diff --git a/cmd/mailfull/catchall.go b/cmd/mailfull/cmd_catchall.go similarity index 80% rename from cmd/mailfull/catchall.go rename to cmd/mailfull/cmd_catchall.go index 9bac493..8de4bd5 100644 --- a/cmd/mailfull/catchall.go +++ b/cmd/mailfull/cmd_catchall.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// CatchAllCommand represents a CatchAllCommand. -type CatchAllCommand struct { +// CmdCatchAll represents a CmdCatchAll. +type CmdCatchAll struct { Meta } // Synopsis returns a one-line synopsis. -func (c *CatchAllCommand) Synopsis() string { +func (c *CmdCatchAll) Synopsis() string { return "Show a catchall user." } // Help returns long-form help text. -func (c *CatchAllCommand) Help() string { +func (c *CmdCatchAll) Help() string { txt := fmt.Sprintf(` Usage: %s %s domain @@ -36,7 +36,7 @@ Required Args: } // Run runs the command and returns the exit status. -func (c *CatchAllCommand) Run(args []string) int { +func (c *CmdCatchAll) Run(args []string) int { if len(args) != 1 { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) return 1 diff --git a/cmd/mailfull/catchallset.go b/cmd/mailfull/cmd_catchallset.go similarity index 86% rename from cmd/mailfull/catchallset.go rename to cmd/mailfull/cmd_catchallset.go index 0d86d23..8191cf5 100644 --- a/cmd/mailfull/catchallset.go +++ b/cmd/mailfull/cmd_catchallset.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// CatchAllSetCommand represents a CatchAllSetCommand. -type CatchAllSetCommand struct { +// CmdCatchAllSet represents a CmdCatchAllSet. +type CmdCatchAllSet struct { Meta } // Synopsis returns a one-line synopsis. -func (c *CatchAllSetCommand) Synopsis() string { +func (c *CmdCatchAllSet) Synopsis() string { return "Set a catchall user." } // Help returns long-form help text. -func (c *CatchAllSetCommand) Help() string { +func (c *CmdCatchAllSet) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain user @@ -42,7 +42,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *CatchAllSetCommand) Run(args []string) int { +func (c *CmdCatchAllSet) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/catchallunset.go b/cmd/mailfull/cmd_catchallunset.go similarity index 83% rename from cmd/mailfull/catchallunset.go rename to cmd/mailfull/cmd_catchallunset.go index 60b7df0..e4f6b5e 100644 --- a/cmd/mailfull/catchallunset.go +++ b/cmd/mailfull/cmd_catchallunset.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// CatchAllUnsetCommand represents a CatchAllUnsetCommand. -type CatchAllUnsetCommand struct { +// CmdCatchAllUnset represents a CmdCatchAllUnset. +type CmdCatchAllUnset struct { Meta } // Synopsis returns a one-line synopsis. -func (c *CatchAllUnsetCommand) Synopsis() string { +func (c *CmdCatchAllUnset) Synopsis() string { return "Unset a catchall user." } // Help returns long-form help text. -func (c *CatchAllUnsetCommand) Help() string { +func (c *CmdCatchAllUnset) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain @@ -40,7 +40,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *CatchAllUnsetCommand) Run(args []string) int { +func (c *CmdCatchAllUnset) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/commit.go b/cmd/mailfull/cmd_commit.go similarity index 79% rename from cmd/mailfull/commit.go rename to cmd/mailfull/cmd_commit.go index 829a955..a47384d 100644 --- a/cmd/mailfull/commit.go +++ b/cmd/mailfull/cmd_commit.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// CommitCommand represents a CommitCommand. -type CommitCommand struct { +// CmdCommit represents a CmdCommit. +type CmdCommit struct { Meta } // Synopsis returns a one-line synopsis. -func (c *CommitCommand) Synopsis() string { +func (c *CmdCommit) Synopsis() string { return "Create databases from the structure of the MailData directory." } // Help returns long-form help text. -func (c *CommitCommand) Help() string { +func (c *CmdCommit) Help() string { txt := fmt.Sprintf(` Usage: %s %s @@ -32,7 +32,7 @@ Description: } // Run runs the command and returns the exit status. -func (c *CommitCommand) Run(args []string) int { +func (c *CmdCommit) Run(args []string) int { repo, err := mailfull.OpenRepository(".") if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err) diff --git a/cmd/mailfull/domainadd.go b/cmd/mailfull/cmd_domainadd.go similarity index 88% rename from cmd/mailfull/domainadd.go rename to cmd/mailfull/cmd_domainadd.go index 9744eb4..5c93dbc 100644 --- a/cmd/mailfull/domainadd.go +++ b/cmd/mailfull/cmd_domainadd.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// DomainAddCommand represents a DomainAddCommand. -type DomainAddCommand struct { +// CmdDomainAdd represents a CmdDomainAdd. +type CmdDomainAdd struct { Meta } // Synopsis returns a one-line synopsis. -func (c *DomainAddCommand) Synopsis() string { +func (c *CmdDomainAdd) Synopsis() string { return "Create a new domain and postmaster." } // Help returns long-form help text. -func (c *DomainAddCommand) Help() string { +func (c *CmdDomainAdd) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain @@ -40,7 +40,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *DomainAddCommand) Run(args []string) int { +func (c *CmdDomainAdd) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/domaindel.go b/cmd/mailfull/cmd_domaindel.go similarity index 85% rename from cmd/mailfull/domaindel.go rename to cmd/mailfull/cmd_domaindel.go index 0a4c782..a558938 100644 --- a/cmd/mailfull/domaindel.go +++ b/cmd/mailfull/cmd_domaindel.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// DomainDelCommand represents a DomainDelCommand. -type DomainDelCommand struct { +// CmdDomainDel represents a CmdDomainDel. +type CmdDomainDel struct { Meta } // Synopsis returns a one-line synopsis. -func (c *DomainDelCommand) Synopsis() string { +func (c *CmdDomainDel) Synopsis() string { return "Delete and backup a domain." } // Help returns long-form help text. -func (c *DomainDelCommand) Help() string { +func (c *CmdDomainDel) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain @@ -40,7 +40,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *DomainDelCommand) Run(args []string) int { +func (c *CmdDomainDel) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/domaindisable.go b/cmd/mailfull/cmd_domaindisable.go similarity index 86% rename from cmd/mailfull/domaindisable.go rename to cmd/mailfull/cmd_domaindisable.go index 83a7d74..f1dd946 100644 --- a/cmd/mailfull/domaindisable.go +++ b/cmd/mailfull/cmd_domaindisable.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// DomainDisableCommand represents a DomainDisableCommand. -type DomainDisableCommand struct { +// CmdDomainDisable represents a CmdDomainDisable. +type CmdDomainDisable struct { Meta } // Synopsis returns a one-line synopsis. -func (c *DomainDisableCommand) Synopsis() string { +func (c *CmdDomainDisable) Synopsis() string { return "Disable a domain temporarily." } // Help returns long-form help text. -func (c *DomainDisableCommand) Help() string { +func (c *CmdDomainDisable) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain @@ -40,7 +40,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *DomainDisableCommand) Run(args []string) int { +func (c *CmdDomainDisable) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/domainenable.go b/cmd/mailfull/cmd_domainenable.go similarity index 86% rename from cmd/mailfull/domainenable.go rename to cmd/mailfull/cmd_domainenable.go index 5d4c924..13e05a3 100644 --- a/cmd/mailfull/domainenable.go +++ b/cmd/mailfull/cmd_domainenable.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// DomainEnableCommand represents a DomainEnableCommand. -type DomainEnableCommand struct { +// CmdDomainEnable represents a CmdDomainEnable. +type CmdDomainEnable struct { Meta } // Synopsis returns a one-line synopsis. -func (c *DomainEnableCommand) Synopsis() string { +func (c *CmdDomainEnable) Synopsis() string { return "Enable a domain." } // Help returns long-form help text. -func (c *DomainEnableCommand) Help() string { +func (c *CmdDomainEnable) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] domain @@ -40,7 +40,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *DomainEnableCommand) Run(args []string) int { +func (c *CmdDomainEnable) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/domains.go b/cmd/mailfull/cmd_domains.go similarity index 80% rename from cmd/mailfull/domains.go rename to cmd/mailfull/cmd_domains.go index 0d4ede2..b2fc11f 100644 --- a/cmd/mailfull/domains.go +++ b/cmd/mailfull/cmd_domains.go @@ -7,18 +7,18 @@ import ( "github.com/directorz/mailfull-go" ) -// DomainsCommand represents a DomainsCommand. -type DomainsCommand struct { +// CmdDomains represents a CmdDomains. +type CmdDomains struct { Meta } // Synopsis returns a one-line synopsis. -func (c *DomainsCommand) Synopsis() string { +func (c *CmdDomains) Synopsis() string { return "Show domains." } // Help returns long-form help text. -func (c *DomainsCommand) Help() string { +func (c *CmdDomains) Help() string { txt := fmt.Sprintf(` Usage: %s %s @@ -34,7 +34,7 @@ Description: } // Run runs the command and returns the exit status. -func (c *DomainsCommand) Run(args []string) int { +func (c *CmdDomains) Run(args []string) int { repo, err := mailfull.OpenRepository(".") if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err) diff --git a/cmd/mailfull/genconfig.go b/cmd/mailfull/cmd_genconfig.go similarity index 82% rename from cmd/mailfull/genconfig.go rename to cmd/mailfull/cmd_genconfig.go index dfc8ab4..b533a12 100644 --- a/cmd/mailfull/genconfig.go +++ b/cmd/mailfull/cmd_genconfig.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// GenConfigCommand represents a GenConfigCommand. -type GenConfigCommand struct { +// CmdGenConfig represents a CmdGenConfig. +type CmdGenConfig struct { Meta } // Synopsis returns a one-line synopsis. -func (c *GenConfigCommand) Synopsis() string { +func (c *CmdGenConfig) Synopsis() string { return "Write a Postfix or Dovecot configuration to stdout." } // Help returns long-form help text. -func (c *GenConfigCommand) Help() string { +func (c *CmdGenConfig) Help() string { txt := fmt.Sprintf(` Usage: %s %s name @@ -37,7 +37,7 @@ Required Args: } // Run runs the command and returns the exit status. -func (c *GenConfigCommand) Run(args []string) int { +func (c *CmdGenConfig) Run(args []string) int { if len(args) != 1 { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) return 1 diff --git a/cmd/mailfull/init.go b/cmd/mailfull/cmd_init.go similarity index 73% rename from cmd/mailfull/init.go rename to cmd/mailfull/cmd_init.go index 12ccd4d..a43a7f5 100644 --- a/cmd/mailfull/init.go +++ b/cmd/mailfull/cmd_init.go @@ -6,18 +6,18 @@ import ( "github.com/directorz/mailfull-go" ) -// InitCommand represents a InitCommand. -type InitCommand struct { +// CmdInit represents a CmdInit. +type CmdInit struct { Meta } // Synopsis returns a one-line synopsis. -func (c *InitCommand) Synopsis() string { +func (c *CmdInit) Synopsis() string { return "Initializes current directory as a Mailfull repository." } // Help returns long-form help text. -func (c *InitCommand) Help() string { +func (c *CmdInit) Help() string { txt := fmt.Sprintf(` Usage: %s %s @@ -32,7 +32,7 @@ Description: } // Run runs the command and returns the exit status. -func (c *InitCommand) Run(args []string) int { +func (c *CmdInit) Run(args []string) int { if err := mailfull.InitRepository("."); err != nil { fmt.Fprintf(c.UI.ErrorWriter, "[ERR] %v\n", err) return 1 diff --git a/cmd/mailfull/useradd.go b/cmd/mailfull/cmd_useradd.go similarity index 88% rename from cmd/mailfull/useradd.go rename to cmd/mailfull/cmd_useradd.go index f97a04f..e8ca007 100644 --- a/cmd/mailfull/useradd.go +++ b/cmd/mailfull/cmd_useradd.go @@ -7,18 +7,18 @@ import ( "github.com/directorz/mailfull-go" ) -// UserAddCommand represents a UserAddCommand. -type UserAddCommand struct { +// CmdUserAdd represents a CmdUserAdd. +type CmdUserAdd struct { Meta } // Synopsis returns a one-line synopsis. -func (c *UserAddCommand) Synopsis() string { +func (c *CmdUserAdd) Synopsis() string { return "Create a new user." } // Help returns long-form help text. -func (c *UserAddCommand) Help() string { +func (c *CmdUserAdd) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] address @@ -41,7 +41,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *UserAddCommand) Run(args []string) int { +func (c *CmdUserAdd) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/usercheckpw.go b/cmd/mailfull/cmd_usercheckpw.go similarity index 88% rename from cmd/mailfull/usercheckpw.go rename to cmd/mailfull/cmd_usercheckpw.go index 7b673c0..bb52261 100644 --- a/cmd/mailfull/usercheckpw.go +++ b/cmd/mailfull/cmd_usercheckpw.go @@ -8,18 +8,18 @@ import ( "github.com/jsimonetti/pwscheme/ssha" ) -// UserCheckPwCommand represents a UserCheckPwCommand. -type UserCheckPwCommand struct { +// CmdUserCheckPw represents a CmdUserCheckPw. +type CmdUserCheckPw struct { Meta } // Synopsis returns a one-line synopsis. -func (c *UserCheckPwCommand) Synopsis() string { +func (c *CmdUserCheckPw) Synopsis() string { return "Check user's password." } // Help returns long-form help text. -func (c *UserCheckPwCommand) Help() string { +func (c *CmdUserCheckPw) Help() string { txt := fmt.Sprintf(` Usage: %s %s address [password] @@ -43,7 +43,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *UserCheckPwCommand) Run(args []string) int { +func (c *CmdUserCheckPw) Run(args []string) int { if len(args) != 1 && len(args) != 2 { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) return 1 diff --git a/cmd/mailfull/userdel.go b/cmd/mailfull/cmd_userdel.go similarity index 88% rename from cmd/mailfull/userdel.go rename to cmd/mailfull/cmd_userdel.go index 41ae12c..260dbad 100644 --- a/cmd/mailfull/userdel.go +++ b/cmd/mailfull/cmd_userdel.go @@ -7,18 +7,18 @@ import ( "github.com/directorz/mailfull-go" ) -// UserDelCommand represents a UserDelCommand. -type UserDelCommand struct { +// CmdUserDel represents a CmdUserDel. +type CmdUserDel struct { Meta } // Synopsis returns a one-line synopsis. -func (c *UserDelCommand) Synopsis() string { +func (c *CmdUserDel) Synopsis() string { return "Delete and backup a user." } // Help returns long-form help text. -func (c *UserDelCommand) Help() string { +func (c *CmdUserDel) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] address @@ -41,7 +41,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *UserDelCommand) Run(args []string) int { +func (c *CmdUserDel) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/userpasswd.go b/cmd/mailfull/cmd_userpasswd.go similarity index 92% rename from cmd/mailfull/userpasswd.go rename to cmd/mailfull/cmd_userpasswd.go index 406cc28..0aa7790 100644 --- a/cmd/mailfull/userpasswd.go +++ b/cmd/mailfull/cmd_userpasswd.go @@ -8,18 +8,18 @@ import ( "github.com/jsimonetti/pwscheme/ssha" ) -// UserPasswdCommand represents a UserPasswdCommand. -type UserPasswdCommand struct { +// CmdUserPasswd represents a CmdUserPasswd. +type CmdUserPasswd struct { Meta } // Synopsis returns a one-line synopsis. -func (c *UserPasswdCommand) Synopsis() string { +func (c *CmdUserPasswd) Synopsis() string { return "Update user's password." } // Help returns long-form help text. -func (c *UserPasswdCommand) Help() string { +func (c *CmdUserPasswd) Help() string { txt := fmt.Sprintf(` Usage: %s %s [-n] address [password] @@ -45,7 +45,7 @@ Optional Args: } // Run runs the command and returns the exit status. -func (c *UserPasswdCommand) Run(args []string) int { +func (c *CmdUserPasswd) Run(args []string) int { noCommit, err := noCommitFlag(&args) if err != nil { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) diff --git a/cmd/mailfull/users.go b/cmd/mailfull/cmd_users.go similarity index 82% rename from cmd/mailfull/users.go rename to cmd/mailfull/cmd_users.go index b9b18c1..e8b20f6 100644 --- a/cmd/mailfull/users.go +++ b/cmd/mailfull/cmd_users.go @@ -7,18 +7,18 @@ import ( "github.com/directorz/mailfull-go" ) -// UsersCommand represents a UsersCommand. -type UsersCommand struct { +// CmdUsers represents a CmdUsers. +type CmdUsers struct { Meta } // Synopsis returns a one-line synopsis. -func (c *UsersCommand) Synopsis() string { +func (c *CmdUsers) Synopsis() string { return "Show users." } // Help returns long-form help text. -func (c *UsersCommand) Help() string { +func (c *CmdUsers) Help() string { txt := fmt.Sprintf(` Usage: %s %s domain @@ -37,7 +37,7 @@ Required Args: } // Run runs the command and returns the exit status. -func (c *UsersCommand) Run(args []string) int { +func (c *CmdUsers) Run(args []string) int { if len(args) != 1 { fmt.Fprintf(c.UI.ErrorWriter, "%v\n", c.Help()) return 1 diff --git a/cmd/mailfull/main.go b/cmd/mailfull/main.go index c2fb110..a4335ec 100644 --- a/cmd/mailfull/main.go +++ b/cmd/mailfull/main.go @@ -43,95 +43,95 @@ func main() { c.Commands = map[string]cli.CommandFactory{ "init": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &InitCommand{Meta: meta}, nil + return &CmdInit{Meta: meta}, nil }, "genconfig": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &GenConfigCommand{Meta: meta}, nil + return &CmdGenConfig{Meta: meta}, nil }, "domains": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &DomainsCommand{Meta: meta}, nil + return &CmdDomains{Meta: meta}, nil }, "domainadd": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &DomainAddCommand{Meta: meta}, nil + return &CmdDomainAdd{Meta: meta}, nil }, "domaindel": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &DomainDelCommand{Meta: meta}, nil + return &CmdDomainDel{Meta: meta}, nil }, "domaindisable": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &DomainDisableCommand{Meta: meta}, nil + return &CmdDomainDisable{Meta: meta}, nil }, "domainenable": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &DomainEnableCommand{Meta: meta}, nil + return &CmdDomainEnable{Meta: meta}, nil }, "aliasdomains": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &AliasDomainsCommand{Meta: meta}, nil + return &CmdAliasDomains{Meta: meta}, nil }, "aliasdomainadd": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &AliasDomainAddCommand{Meta: meta}, nil + return &CmdAliasDomainAdd{Meta: meta}, nil }, "aliasdomaindel": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &AliasDomainDelCommand{Meta: meta}, nil + return &CmdAliasDomainDel{Meta: meta}, nil }, "users": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &UsersCommand{Meta: meta}, nil + return &CmdUsers{Meta: meta}, nil }, "useradd": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &UserAddCommand{Meta: meta}, nil + return &CmdUserAdd{Meta: meta}, nil }, "userdel": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &UserDelCommand{Meta: meta}, nil + return &CmdUserDel{Meta: meta}, nil }, "userpasswd": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &UserPasswdCommand{Meta: meta}, nil + return &CmdUserPasswd{Meta: meta}, nil }, "usercheckpw": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &UserCheckPwCommand{Meta: meta}, nil + return &CmdUserCheckPw{Meta: meta}, nil }, "aliasusers": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &AliasUsersCommand{Meta: meta}, nil + return &CmdAliasUsers{Meta: meta}, nil }, "aliasuseradd": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &AliasUserAddCommand{Meta: meta}, nil + return &CmdAliasUserAdd{Meta: meta}, nil }, "aliasusermod": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &AliasUserModCommand{Meta: meta}, nil + return &CmdAliasUserMod{Meta: meta}, nil }, "aliasuserdel": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &AliasUserDelCommand{Meta: meta}, nil + return &CmdAliasUserDel{Meta: meta}, nil }, "catchall": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &CatchAllCommand{Meta: meta}, nil + return &CmdCatchAll{Meta: meta}, nil }, "catchallset": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &CatchAllSetCommand{Meta: meta}, nil + return &CmdCatchAllSet{Meta: meta}, nil }, "catchallunset": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &CatchAllUnsetCommand{Meta: meta}, nil + return &CmdCatchAllUnset{Meta: meta}, nil }, "commit": func() (cli.Command, error) { meta.SubCmdName = c.Subcommand() - return &CommitCommand{Meta: meta}, nil + return &CmdCommit{Meta: meta}, nil }, }