-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: pass in optional role flag when using members invite #90
feat: pass in optional role flag when using members invite #90
Conversation
This pull request has been linked to Shortcut Story #238446: pass in option |
cmd/members/invite.go
Outdated
@@ -33,6 +33,19 @@ func NewInviteCmd(client members.Client) (*cobra.Command, error) { | |||
return nil, err | |||
} | |||
|
|||
var role string | |||
cmd.Flags().StringVarP( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be StringP
instead if we don't need the local role
var?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed!
@@ -85,3 +85,59 @@ func TestInvite(t *testing.T) { | |||
assert.EqualError(t, err, "base-uri is invalid"+errorHelp) | |||
}) | |||
} | |||
|
|||
func TestInviteWithOptionalRole(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker, but you could probably make these subtests of TestInvite
.
Adds an optional flag for the
members invite
command to pass in a built-in role that will apply to all members invited. Default value is reader.