Skip to content

Commit

Permalink
feat: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
0michalsokolowski0 committed Sep 27, 2024
1 parent c4ac4c0 commit b628f0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
18 changes: 10 additions & 8 deletions internal/cmd/blueprint/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (c *deployCommand) deploy(cliCtx *cli.Context) error {
var mutation struct {
BlueprintCreateStack struct {
StackID string `graphql:"stackID"`
RunID string `graphql:"runID"`
} `graphql:"blueprintCreateStack(id: $id, input: $input)"`
}

Expand All @@ -91,7 +90,7 @@ func (c *deployCommand) deploy(cliCtx *cli.Context) error {
}

url := authenticated.Client.URL("/stack/%s", mutation.BlueprintCreateStack.StackID)
fmt.Printf("Created stack can found: %q", url)
fmt.Printf("\nCreated stack: %q", url)

return nil
}
Expand All @@ -105,9 +104,8 @@ func formatLabel(input blueprintInput) string {

func promptForTextInput(input blueprintInput) (string, error) {
prompt := promptui.Prompt{
Label: formatLabel(input),
Default: input.Default,
IsConfirm: input.Default != "",
Label: formatLabel(input),
Default: input.Default,
}
result, err := prompt.Run()
if err != nil {
Expand All @@ -119,7 +117,9 @@ func promptForTextInput(input blueprintInput) (string, error) {

func promptForSecretInput(input blueprintInput) (string, error) {
prompt := promptui.Prompt{
Label: formatLabel(input),
Label: formatLabel(input),
Default: input.Default,
Mask: '*',
}
result, err := prompt.Run()
if err != nil {
Expand All @@ -131,7 +131,8 @@ func promptForSecretInput(input blueprintInput) (string, error) {

func promptForIntegerInput(input blueprintInput) (string, error) {
prompt := promptui.Prompt{
Label: formatLabel(input),
Label: formatLabel(input),
Default: input.Default,
Validate: func(s string) error {
_, err := strconv.Atoi(s)
if err != nil {
Expand All @@ -151,7 +152,8 @@ func promptForIntegerInput(input blueprintInput) (string, error) {

func promptForFloatInput(input blueprintInput) (string, error) {
prompt := promptui.Prompt{
Label: formatLabel(input),
Label: formatLabel(input),
Default: input.Default,
Validate: func(s string) error {
_, err := strconv.ParseFloat(s, 64)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion internal/cmd/blueprint/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ func listBlueprintsTable(
// searchAllBlueprints returns a list of stacks based on the provided search input.
// input.First limits the total number of returned stacks, if not provided all stacks are returned.
func searchAllBlueprints(ctx context.Context, input structs.SearchInput) ([]blueprintNode, error) {
// Check BE for max here
const maxPageSize = 50

var limit int
Expand Down
6 changes: 2 additions & 4 deletions internal/cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ var FlagSearch = &cli.StringFlag{

// FlagShowLabels is a flag used for indicating that labels should be printed when outputting data in the table format.
var FlagShowLabels = &cli.BoolFlag{
Name: "show-labels",
Usage: "[Optional] Indicates that labels should be printed when outputting data in the table format",
Required: false,
Value: false,
Name: "show-labels",
Usage: "[Optional] Indicates that labels should be printed when outputting data in the table format",
}

0 comments on commit b628f0b

Please sign in to comment.