Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ivannalisetska
Copy link
Contributor

@ivannalisetska ivannalisetska commented Sep 8, 2025

  1. Added persistent flag to base build command (pkg/cmd/build/build.go)
  2. Updated all build subcommands to use the persistent flag
  3. Removed duplicate flag definitions from all subcommands
    build view
Screenshot 2025-09-08 at 3 23 09 PM build list Screenshot 2025-09-08 at 3 33 14 PM

Previously we had an error:

bk build view -p --branch 'main'| cat
Error: unknown shorthand flag: 'p' in -p

Screenshot 2025-09-08 at 3 32 14 PM

Support -p as shorthand for --pipeline in build view
Aligns with other build subcommands (new, list, watch, rebuild, cancel)
@ivannalisetska ivannalisetska requested a review from a team as a code owner September 8, 2025 20:20
Copy link
Contributor

@mcncl mcncl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could actually use persistentFlags on the base build.go

cmd.PersistentFlags().StringP("pipeline", "p", "", "The pipeline to use. This can be a {pipeline slug} or in the format {org slug}/{pipeline slug}.")

And where we want to get the flag, such as in view.go file we could use the following before we use the resolvers (line 59)

opts.Pipeline, _ = cmd.Flags().GetString("pipeline")

Then each setting of -p or --pipeline in view.go, list.go etc can be deleted

2. All subcommands use cmd.Flags().GetString(pipeline)
3. All duplicate flags removed from individual commands
4. Tested
@ivannalisetska ivannalisetska requested a review from mcncl September 8, 2025 21:30
@ivannalisetska ivannalisetska merged commit 4567024 into main Sep 8, 2025
1 check passed
@ivannalisetska ivannalisetska deleted the ivannalisetska/SUP-4173 branch September 8, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants