- Notifications
You must be signed in to change notification settings - Fork927
chore: add edit organization role to cli#13365
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
7d69335
b005cdc
677855a
57723a6
fbd8cf3
2bc99cd
da0107c
ce841f9
e5082ae
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -56,6 +56,7 @@ type SelectOptions struct { | ||
Options []string | ||
// Default will be highlighted first if it's a valid option. | ||
Default string | ||
Message string | ||
Size int | ||
HideSearch bool | ||
} | ||
@@ -122,6 +123,7 @@ func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) { | ||
Options: opts.Options, | ||
Default: defaultOption, | ||
PageSize: opts.Size, | ||
Message: opts.Message, | ||
}, &value, survey.WithIcons(func(is *survey.IconSet) { | ||
is.Help.Text = "Type to search" | ||
if opts.HideSearch { | ||
@@ -138,15 +140,22 @@ func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) { | ||
return value, err | ||
} | ||
type MultiSelectOptions struct { | ||
Message string | ||
Options []string | ||
Defaults []string | ||
} | ||
func MultiSelect(inv *serpent.Invocation, opts MultiSelectOptions) ([]string, error) { | ||
// Similar hack is applied to Select() | ||
if flag.Lookup("test.v") != nil { | ||
returnopts.Defaults, nil | ||
} | ||
prompt := &survey.MultiSelect{ | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The prompt doesn't explain the keybindings:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yup it does not. I added it as a note in the PR, just made it an issue:#13427 I talked to@mtojek about this, and I also see Kyle made some adjustments. Essentially, we cannot have different survey templates for different questions. They all share the same global. This global has all the things you mentioned and more. I'd like to revert our change as much as possible, but I'll have to probably adjust every instance that we use this and make sure I did not break anything. Feels excessive for this PR imo. | ||
Options: opts.Options, | ||
Default: opts.Defaults, | ||
Message: opts.Message, | ||
} | ||
var values []string | ||
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.