added flags are not parsed check

This commit is contained in:
Shreyas Goenka 2025-03-03 18:35:03 +01:00
parent 58d28a9c92
commit 993956294a
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
3 changed files with 6 additions and 26 deletions

View File

@ -4,3 +4,6 @@ hello, world
>>> [CLI] bundle exec -- pwd >>> [CLI] bundle exec -- pwd
[TMPDIR] [TMPDIR]
>>> [CLI] bundle exec -- echo --help
--help

View File

@ -1,3 +1,6 @@
trace $CLI bundle exec -- echo "hello, world" trace $CLI bundle exec -- echo "hello, world"
trace $CLI bundle exec -- pwd trace $CLI bundle exec -- pwd
# The CLI should not parse the --help flag and should pass it as is to echo.
trace $CLI bundle exec -- echo --help

View File

@ -13,29 +13,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
// TODO: test that -- works with flags as well.
// TODO: Can bundle auth be resolved twice? What about:
// databricks bundle exec -t foo -- databricks jobs list -t bar?
// OR
// databricks bundle exec -- databricks jobs list -t bar?
// OR
// databricks bundle exec -- databricks jobs list?
// OR
// databricks bundle exec -t foo -- databricks jobs list?
//
// For the first two, undefined behavior is fine. For the latter two we need to ensure
// that the target from exec is respected.
//
// Add tests for all four of these cases.
// --> Do I need similar tests for --profile as well?
// --> Also add test for what happens with a default target?
// TODO: Add acceptance test that flags are indeed not parsed by the exec command and
// instead are parsed by the child command.
// # TODO: Table test casing the profile flag permutations
func newExecCommand() *cobra.Command { func newExecCommand() *cobra.Command {
execCmd := &cobra.Command{ execCmd := &cobra.Command{
Use: "exec", Use: "exec",
@ -150,8 +127,5 @@ Examples:
}, },
} }
// TODO: Is this needed to make -- work with flags? What does this option do?
// execCmd.Flags().SetInterspersed(false)
return execCmd return execCmd
} }