Skip to content

Commit

Permalink
Get show-permission flag with BoolP() and GetBool()
Browse files Browse the repository at this point in the history
  • Loading branch information
litencatt committed Nov 9, 2021
1 parent 2315fb8 commit e4aa732
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
"github.com/snowhork/rdiam/cmd/impl"
)

var (
o impl.Options
)

func init() {
rootCmd.AddCommand(newInspectCmd())
}
Expand Down Expand Up @@ -47,10 +43,17 @@ func newInspectCmd() *cobra.Command {
arg = args[0]
}

var o impl.Options
if showPermission, err := cmd.Flags().GetBool("show-permission"); err != nil {
return err
} else {
o.ShowQueryModifyPermission = showPermission
}

return impl.InspectCmd(globalClient, arg, o)
},
}
cmd.Flags().BoolVarP(&o.ShowQueryModifyPermission, "show-permission", "p", false, "Show query modify permission")
cmd.Flags().BoolP("show-permission", "p", false, "Show query modify permission")

return cmd
}

0 comments on commit e4aa732

Please sign in to comment.