go-arg icon indicating copy to clipboard operation
go-arg copied to clipboard

Passing the no-more-options string "--" twice or more

Open alexflint opened this issue 1 year ago • 0 comments

Passing the no-more-options string "--" twice or more should pass the second and subsequent ones through as positionals. This makes it possible to pass the string "--" as a positional:

var args struct {
  X []string `arg:"positional"
}
arg.MustParse(&args)
./example -- test test2 -- test3  // args.X is [test, test2, --, test3]

alexflint avatar Oct 21 '24 21:10 alexflint