accounts: Use singular form
authorMikael Berthe <mikael@lilotux.net>
Wed, 21 Mar 2018 14:08:10 +0100
changeset 209 3772cc6b3d0a
parent 208 7a830fed2ba3
child 210 94be15243195
accounts: Use singular form Most of the account subcommands relate to a single account so use "account" as the main name and "accounts" as an alias.
README.md
cmd/accounts.go
--- a/README.md	Wed Mar 21 14:02:49 2018 +0100
+++ b/README.md	Wed Mar 21 14:08:10 2018 +0100
@@ -104,10 +104,11 @@
 ``` sh
 % madonctl accounts blocked                       # List blocked accounts
 % madonctl accounts muted                         # List muted accounts
-% madonctl accounts notifications --list --all    # List really all notifications
-% madonctl accounts notifications --list --clear  # List and clear notifications
-% madonctl accounts notifications --notification-id 1234 # Display notification
-% madonctl accounts notifications --dismiss --notification-id 1234
+
+% madonctl account notifications --list --all    # List really all notifications
+% madonctl account notifications --list --clear  # List and clear notifications
+% madonctl account notifications --notification-id 1234 # Display notification
+% madonctl account notifications --dismiss --notification-id 1234
 ```
 
 Note: By default, madonctl will send a single query.  If you want all available
@@ -117,16 +118,16 @@
 
 **Update** your account information:
 ``` sh
-% madonctl accounts update --display-name "John"  # Update display name
-% madonctl accounts update --note "Newcomer"      # Update user note (bio)
-% madonctl accounts update --note ""              # Clear note
-% madonctl accounts update --avatar me.png        # Update avatar
+% madonctl account update --display-name "John"  # Update display name
+% madonctl account update --note "Newcomer"      # Update user note (bio)
+% madonctl account update --note ""              # Clear note
+% madonctl account update --avatar me.png        # Update avatar
 ```
 
 See your own **posts**:
 ``` sh
-% madonctl accounts statuses                      # See last posts
-% madonctl accounts statuses --all                # See all statuses
+% madonctl account statuses                      # See last posts
+% madonctl account statuses --all                # See all statuses
 ```
 
 Display accounts you're **following** or your **followers**:
@@ -155,12 +156,12 @@
 
 **Follow** an account with known ID:
 ``` sh
-% madonctl accounts follow --account-id 1234
+% madonctl account follow --account-id 1234
 ```
 
 Follow a remote account:
 ``` sh
-% madonctl accounts follow --remote Gargron@mastodon.social
+% madonctl account follow --remote Gargron@mastodon.social
 ```
 
 **Search** for accounts, statuses or hashtags:
@@ -176,8 +177,8 @@
 @domain suffix if the user is on the same instance).  The --user-id flag can
 also contain an HTTP account URL.
 ``` sh
-% madonctl accounts --user-id Gargron@mastodon.social -l5 statuses # Last 5 statuses
-% madonctl accounts --user-id https://mastodon.social/@Gargron -l5 statuses # Same
+% madonctl account --user-id Gargron@mastodon.social -l5 statuses # Last 5 statuses
+% madonctl account --user-id https://mastodon.social/@Gargron -l5 statuses # Same
 ```
 Please note that the form "Gargron@mastodon.social" will only work if this
 account is known by the instance.  If it is unknown, the https link should work
@@ -217,15 +218,15 @@
 
 (Almost) All commands have a **customizable output**:
 ``` sh
-% madonctl accounts show            # Display an account
-% madonctl accounts show -o yaml    # Display an account, in yaml
-% madonctl accounts show -o json    # Display an account, in json
+% madonctl account show            # Display an account
+% madonctl account show -o yaml    # Display an account, in yaml
+% madonctl account show -o json    # Display an account, in json
 % madonctl stream local -o json     # Stream local timeline and output to JSON
 ```
 
 You can also use Go (Golang) **templates**:
 ``` sh
-% madonctl accounts --account-id 1 followers --template '{{.acct}}{{"\n"}}'
+% madonctl account --account-id 1 followers --template '{{.acct}}{{"\n"}}'
 ```
 
 You can write and use [themes](templates) as well:
--- a/cmd/accounts.go	Wed Mar 21 14:02:49 2018 +0100
+++ b/cmd/accounts.go	Wed Mar 21 14:08:10 2018 +0100
@@ -98,8 +98,8 @@
 // accountsCmd represents the accounts command
 // This command does nothing without a subcommand
 var accountsCmd = &cobra.Command{
-	Use:     "accounts [--account-id ID] subcommand",
-	Aliases: []string{"account"},
+	Use:     "account [--account-id ID] subcommand",
+	Aliases: []string{"accounts"},
 	Short:   "Account-related functions",
 	//Long:    `TBW...`, // TODO
 }
@@ -114,13 +114,13 @@
 		Short:   "Display the account",
 		Example: `  madonctl account show   # Display your own account
 
-  madonctl accounts show --account-id 1234
-  madonctl accounts show --user-id Gargron@mastodon.social
-  madonctl accounts show --user-id https://mastodon.social/@Gargron
+  madonctl account show --account-id 1234
+  madonctl account show --user-id Gargron@mastodon.social
+  madonctl account show --user-id https://mastodon.social/@Gargron
 
-  madonctl accounts show 1234
-  madonctl accounts show Gargron@mastodon.social
-  madonctl accounts show https://mastodon.social/@Gargron
+  madonctl account show 1234
+  madonctl account show Gargron@mastodon.social
+  madonctl account show https://mastodon.social/@Gargron
 `,
 		RunE: func(cmd *cobra.Command, args []string) error {
 			return accountSubcommandsRunE(cmd.Name(), args)
@@ -191,11 +191,11 @@
 	Use:     "statuses",
 	Aliases: []string{"st"},
 	Short:   "Display the account statuses",
-	Example: `  madonctl accounts statuses
-  madonctl accounts statuses 404                         # local account numeric ID
-  madonctl accounts statuses @McKael                     # local account
-  madonctl accounts statuses Gargron@mastodon.social     # remote (known account)
-  madonctl accounts statuses https://mastodon.social/@Gargron  # any account URL
+	Example: `  madonctl account statuses
+  madonctl account statuses 404                         # local account numeric ID
+  madonctl account statuses @McKael                     # local account
+  madonctl account statuses Gargron@mastodon.social     # remote (known account)
+  madonctl account statuses https://mastodon.social/@Gargron  # any account URL
 `,
 	RunE: func(cmd *cobra.Command, args []string) error {
 		return accountSubcommandsRunE(cmd.Name(), args)
@@ -205,10 +205,10 @@
 var accountFollowRequestsSubcommand = &cobra.Command{
 	Use:     "follow-requests",
 	Aliases: []string{"follow-request", "fr"},
-	Example: `  madonctl accounts follow-requests --list
-  madonctl accounts follow-requests --account-id X --accept
-  madonctl accounts follow-requests --account-id Y --reject`,
-	Short: "List, accept or deny a follow request",
+	Short:   "List, accept or deny a follow request",
+	Example: `  madonctl account follow-requests --list
+  madonctl account follow-requests --account-id X --accept
+  madonctl account follow-requests --account-id Y --reject`,
 	RunE: func(cmd *cobra.Command, args []string) error {
 		return accountSubcommandsRunE(cmd.Name(), args)
 	},
@@ -217,13 +217,13 @@
 	Use:   "follow",
 	Short: "Follow or unfollow the account",
 	Example: `# Argument type can be set explicitly:
-  madonctl accounts follow --account-id 1234
-  madonctl accounts follow --remote Gargron@mastodon.social
+  madonctl account follow --account-id 1234
+  madonctl account follow --remote Gargron@mastodon.social
 
 # Or argument type can be guessed:
-  madonctl accounts follow 4800
-  madonctl accounts follow Gargron@mastodon.social --show-reblogs=false
-  madonctl accounts follow https://mastodon.social/@Gargron
+  madonctl account follow 4800
+  madonctl account follow Gargron@mastodon.social --show-reblogs=false
+  madonctl account follow https://mastodon.social/@Gargron
 `,
 	RunE: func(cmd *cobra.Command, args []string) error {
 		return accountSubcommandsRunE(cmd.Name(), args)
@@ -257,8 +257,8 @@
 var accountReportsSubcommand = &cobra.Command{
 	Use:   "reports",
 	Short: "List reports or report a user account",
-	Example: `  madonctl accounts reports --list
-  madonctl accounts reports --account-id ACCOUNT --status-ids ID... --comment TEXT`,
+	Example: `  madonctl account reports --list
+  madonctl account reports --account-id ACCOUNT --status-ids ID... --comment TEXT`,
 	RunE: func(cmd *cobra.Command, args []string) error {
 		return accountSubcommandsRunE(cmd.Name(), args)
 	},
@@ -275,9 +275,9 @@
 
 Please note the avatar and header images cannot be removed, they can only be
 replaced.`,
-	Example: `  madonctl accounts update --display-name "Mr President"
-  madonctl accounts update --note "I like madonctl"
-  madonctl accounts update --avatar happyface.png`,
+	Example: `  madonctl account update --display-name "Mr President"
+  madonctl account update --note "I like madonctl"
+  madonctl account update --avatar happyface.png`,
 	RunE: func(cmd *cobra.Command, args []string) error {
 		return accountSubcommandsRunE(cmd.Name(), args)
 	},