Skip to content

Commit

Permalink
cmd: Properly names flags
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored and arekkas committed May 28, 2018
1 parent 8584d94 commit af2c3b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmd/client/handler_warden.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func newWardenHandler() *WardenHandler {
func (h *WardenHandler) IsOAuth2AccessTokenAuthorized(cmd *cobra.Command, args []string) {
token, _ := cmd.Flags().GetString("token")
scope, _ := cmd.Flags().GetStringArray("scope")
action, _ := cmd.Flags().GetString("actions")
resource, _ := cmd.Flags().GetString("resources")
action, _ := cmd.Flags().GetString("action")
resource, _ := cmd.Flags().GetString("resource")

m := h.newWardenManager(cmd)
_, response, err := m.IsOAuth2AccessTokenAuthorized(keto.WardenOAuth2AccessTokenAuthorizationRequest{
Expand All @@ -66,8 +66,8 @@ func (h *WardenHandler) IsOAuth2AccessTokenAuthorized(cmd *cobra.Command, args [
}
func (h *WardenHandler) IsSubjectAuthorized(cmd *cobra.Command, args []string) {
subject, _ := cmd.Flags().GetString("subject")
action, _ := cmd.Flags().GetString("actions")
resource, _ := cmd.Flags().GetString("resources")
action, _ := cmd.Flags().GetString("action")
resource, _ := cmd.Flags().GetString("resource")

m := h.newWardenManager(cmd)
_, response, err := m.IsSubjectAuthorized(keto.WardenSubjectAuthorizationRequest{
Expand Down
6 changes: 3 additions & 3 deletions cmd/warden_subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func init() {
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:

subjectCmd.Flags().String("subject", "", "The request's subject")
subjectCmd.Flags().String("action", "", "The request's action")
subjectCmd.Flags().String("resource", "", "The request's resource")
subjectCmd.Flags().StringP("subject", "s", "", "The request's subject")
subjectCmd.Flags().StringP("action", "a", "", "The request's action")
subjectCmd.Flags().StringP("resource", "r", "", "The request's resource")
}

0 comments on commit af2c3b5

Please sign in to comment.