File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ func Execute(version string) {
104
104
},
105
105
{
106
106
Name : "exec" ,
107
+ // We want all arguments to exec to remain unparsed so we can pass them
108
+ // directly to the command asdf whill exec on behalf of the shim/user.
109
+ // SkipFlagParsing tells urfave/cli to do this.
110
+ SkipFlagParsing : true ,
107
111
Action : func (_ context.Context , cmd * cli.Command ) error {
108
112
command := cmd .Args ().Get (0 )
109
113
args := cmd .Args ().Slice ()
Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ teardown() {
34
34
[ " $status " -eq 0 ]
35
35
}
36
36
37
+ @test " asdf exec should pass all arguments including flags to executable" {
38
+ echo " dummy 1.0" > " $PROJECT_DIR /.tool-versions"
39
+ run asdf install
40
+
41
+ run asdf exec dummy --mytestflag hello
42
+ [ " $output " = " This is Dummy 1.0! hello --mytestflag" ]
43
+ [ " $status " -eq 0 ]
44
+ }
45
+
37
46
@test " asdf exec should pass all arguments to executable even if shim is not in PATH" {
38
47
echo " dummy 1.0" > " $PROJECT_DIR /.tool-versions"
39
48
run asdf install
You can’t perform that action at this time.
0 commit comments