aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-07-28 20:24:24 +0200
committerMichael Muré <batolettre@gmail.com>2020-07-28 20:24:24 +0200
commitae5c0967cec40a7dcf9804ff592a4d15f1b26569 (patch)
tree7c1ba7626fd8158be030876d44ba55daf465d694 /commands/user.go
parent51c887ff9dd4f2a5f65d2d3de57f8a7729b1010d (diff)
downloadgit-bug-ae5c0967cec40a7dcf9804ff592a4d15f1b26569.tar.gz
commands: cleanup the command's usage to avoid warnings when generating the doc
Diffstat (limited to 'commands/user.go')
-rw-r--r--commands/user.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/commands/user.go b/commands/user.go
index 8a6aef53..d4d3fecd 100644
--- a/commands/user.go
+++ b/commands/user.go
@@ -10,7 +10,7 @@ import (
)
type userOptions struct {
- fieldsQuery string
+ fields string
}
func newUserCommand() *cobra.Command {
@@ -18,7 +18,7 @@ func newUserCommand() *cobra.Command {
options := userOptions{}
cmd := &cobra.Command{
- Use: "user [<user-id>]",
+ Use: "user [USER-ID]",
Short: "Display or change the user identity.",
PreRunE: loadBackendEnsureUser(env),
PostRunE: closeBackend(env),
@@ -34,7 +34,7 @@ func newUserCommand() *cobra.Command {
flags := cmd.Flags()
flags.SortFlags = false
- flags.StringVarP(&options.fieldsQuery, "field", "f", "",
+ flags.StringVarP(&options.fields, "field", "f", "",
"Select field to display. Valid values are [email,humanId,id,lastModification,lastModificationLamport,login,metadata,name]")
return cmd
@@ -57,8 +57,8 @@ func runUser(env *Env, opts userOptions, args []string) error {
return err
}
- if opts.fieldsQuery != "" {
- switch opts.fieldsQuery {
+ if opts.fields != "" {
+ switch opts.fields {
case "email":
env.out.Printf("%s\n", id.Email())
case "login":
@@ -80,7 +80,7 @@ func runUser(env *Env, opts userOptions, args []string) error {
env.out.Printf("%s\n", id.Name())
default:
- return fmt.Errorf("\nUnsupported field: %s\n", opts.fieldsQuery)
+ return fmt.Errorf("\nUnsupported field: %s\n", opts.fields)
}
return nil