1
0
mirror of https://github.com/directorz/mailfull-go.git synced 2025-12-18 01:57:04 +00:00

Change output format of domains subcommands #8

This commit is contained in:
teru
2016-08-23 17:53:49 +09:00
parent 009ee84e63
commit 49dd05f3bf

View File

@@ -25,6 +25,7 @@ Usage:
Description: Description:
%s %s
Disabled domains are marked "!" the beginning.
`, `,
c.CmdName, c.SubCmdName, c.CmdName, c.SubCmdName,
c.Synopsis()) c.Synopsis())
@@ -48,7 +49,12 @@ func (c *DomainsCommand) Run(args []string) int {
sort.Sort(mailfull.DomainSlice(domains)) sort.Sort(mailfull.DomainSlice(domains))
for _, domain := range domains { for _, domain := range domains {
fmt.Fprintf(c.UI.Writer, "%s\n", domain.Name()) disableStr := ""
if domain.Disabled() {
disableStr = "!"
}
fmt.Fprintf(c.UI.Writer, "%s%s\n", disableStr, domain.Name())
} }
return 0 return 0