Skip to content

Commit

Permalink
Remove IsInteractive
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket committed Mar 12, 2021
1 parent fa419aa commit 47bb30c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ var (
DefaultValue: "",
Help: "Name of the application.",
IsRequired: true,
IsInteractive: true,
}
appDescription = Flag{
Name: "Description",
Expand All @@ -34,7 +33,6 @@ var (
DefaultValue: "",
Help: "Description of the application. Max character count is 140.",
IsRequired: false,
IsInteractive: true,
}
appAuthMethod = Flag{
Name: "Auth Method",
Expand All @@ -43,7 +41,6 @@ var (
DefaultValue: "",
Help: "Defines the requested authentication method for the token endpoint. Possible values are 'None' (public application without a client secret), 'Post' (application uses HTTP POST parameters) or 'Basic' (application uses HTTP Basic).",
IsRequired: false,
IsInteractive: false,
}
)

Expand Down
3 changes: 1 addition & 2 deletions internal/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type Flag struct {
DefaultValue string
Help string
IsRequired bool
IsInteractive bool
}

func (f *Flag) Ask(cmd *cobra.Command, value interface{}) error {
Expand All @@ -38,7 +37,7 @@ func ask(cmd *cobra.Command, f *Flag, value interface{}, isUpdate bool) error {
shouldAsk = shouldPrompt(cmd, f.LongForm)
}

if f.IsInteractive && shouldAsk {
if shouldAsk {
input := prompt.TextInput("", fmt.Sprintf("%s:", f.Name), f.Help, f.IsRequired)

if err := prompt.AskOne(input, value); err != nil {
Expand Down

0 comments on commit 47bb30c

Please sign in to comment.