Skip to content

Commit 3970610

Browse files
authored
fix: CLI_ARGS is a string and not an array (#2191)
1 parent bf4e796 commit 3970610

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

args/args.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ import (
1313
// Get fetches the remaining arguments after CLI parsing and splits them into
1414
// two groups: the arguments before the double dash (--) and the arguments after
1515
// the double dash.
16-
func Get() ([]string, []string, error) {
16+
func Get() ([]string, string, error) {
1717
args := pflag.Args()
1818
doubleDashPos := pflag.CommandLine.ArgsLenAtDash()
1919

2020
if doubleDashPos == -1 {
21-
return args, nil, nil
21+
return args, "", nil
2222
}
2323

2424
var quotedCliArgs []string
2525
for _, arg := range args[doubleDashPos:] {
2626
quotedCliArg, err := syntax.Quote(arg, syntax.LangBash)
2727
if err != nil {
28-
return nil, nil, err
28+
return nil, "", err
2929
}
3030
quotedCliArgs = append(quotedCliArgs, quotedCliArg)
3131
}
3232

33-
return args[:doubleDashPos], quotedCliArgs, nil
33+
return args[:doubleDashPos], strings.Join(quotedCliArgs, " "), nil
3434
}
3535

3636
// Parse parses command line argument: tasks and global variables

cmd/task/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func run() error {
7676
if err != nil {
7777
return err
7878
}
79-
_, args, err := args.Get()
79+
args, _, err := args.Get()
8080
if err != nil {
8181
return err
8282
}

0 commit comments

Comments
 (0)