mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 00:46:36 +03:00
add "mox config account list", printing all accounts and whether they are disabled
based on question from wisse on slack
This commit is contained in:
22
main.go
22
main.go
@ -145,6 +145,7 @@ var commands = []struct {
|
||||
{"config dnsrecords", cmdConfigDNSRecords},
|
||||
{"config describe-domains", cmdConfigDescribeDomains},
|
||||
{"config describe-static", cmdConfigDescribeStatic},
|
||||
{"config account list", cmdConfigAccountList},
|
||||
{"config account add", cmdConfigAccountAdd},
|
||||
{"config account rm", cmdConfigAccountRemove},
|
||||
{"config account disable", cmdConfigAccountDisable},
|
||||
@ -996,6 +997,27 @@ func ctlcmdConfigAccountRemove(ctl *ctl, account string) {
|
||||
fmt.Println("account removed")
|
||||
}
|
||||
|
||||
func cmdConfigAccountList(c *cmd) {
|
||||
c.help = `List all accounts.
|
||||
|
||||
Each account is printed on a line, with optional additional tab-separated
|
||||
information, such as "(disabled)".
|
||||
`
|
||||
args := c.Parse()
|
||||
if len(args) != 0 {
|
||||
c.Usage()
|
||||
}
|
||||
|
||||
mustLoadConfig()
|
||||
ctlcmdConfigAccountList(xctl())
|
||||
}
|
||||
|
||||
func ctlcmdConfigAccountList(ctl *ctl) {
|
||||
ctl.xwrite("accountlist")
|
||||
ctl.xreadok()
|
||||
ctl.xstreamto(os.Stdout)
|
||||
}
|
||||
|
||||
func cmdConfigAccountDisable(c *cmd) {
|
||||
c.params = "account message"
|
||||
c.help = `Disable login for an account, showing message to users when they try to login.
|
||||
|
Reference in New Issue
Block a user