Skip to content
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

Suppliment bundle location with positional arg #168

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

hedge-sparrow
Copy link
Member

Left the --support-bundle-location // -c flag in place to not dusrupt existing use, but it's no longer mandatory. sbctl subcommands serve and shell will take the first positional argument as the bundle location.

fixes #136
fixes #59

Left the --support-bundle-location // -c flag in place to not dusrupt
existing use, but it's no longer mandatory. sbctl subcommands
`serve` and `shell` will take the first positional argument as the
bundle location.
@hedge-sparrow hedge-sparrow requested review from banjoh and xavpaice July 29, 2024 09:14
@@ -23,6 +23,7 @@ func ServeCmd() *cobra.Command {
Use: "serve",
Short: "Start API server",
Long: `Start API server`,
Args: cobra.MaximumNArgs(1),
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this make the positional parameter mandatory, meaning that sbctl shell -s support-bundle.tar.gz stops working?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, ExactArgs or MinimumNArgs would make the argument mandatory. MaximumNArgs was chosen because it allows for 0 arguments.

The serve and shell subcommands currently accept no arguments so the existing behavior remains the untouched.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

NVM. I tested your PR and it works as intended.

Copy link
Member

Choose a reason for hiding this comment

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

Yer, I misread Max as Min and jumped the gun :D

@@ -23,6 +23,7 @@ func ServeCmd() *cobra.Command {
Use: "serve",
Short: "Start API server",
Long: `Start API server`,
Args: cobra.MaximumNArgs(1),
Copy link
Member

Choose a reason for hiding this comment

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

Yer, I misread Max as Min and jumped the gun :D

@hedge-sparrow hedge-sparrow merged commit 357bc5b into main Jul 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants