`filecontent` argument fields appear to accept multiple arguments
I just updated to the latest commit (919e70103f7a7068ebccb991e24836f2933529fd) because I wanted to use the new type:"filecontent" feature (thank you!). It works as expected, but I notice in the help output the argument is followed by ..., which I believe implies multiple arguments could be supplied. Is this an artifact of the field type being []byte?
See <function-io> in the help output below.
$ _output/bin/linux_arm64/xfn run negz/xfn-nop:latest ~/fnio.yaml moo
Usage: crossplane run <image> <function-io> ...
Run a Composition Function.
Arguments:
<image> OCI image to run.
<function-io> ... YAML encoded FunctionIO to pass to the function.
Flags:
-h, --help Show context-sensitive help.
-d, --debug Print verbose logging statements.
-v, --version Print version and quit.
-c, --cache-dir="/xfn" Directory used for caching function images and containers.
--timeout=30s Maximum time for which the function may run before being killed.
--map-root-uid=100000 UID that will map to 0 in the function's user namespace. The following 65336 UIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID.
--map-root-gid=100000 GID that will map to 0 in the function's user namespace. The following 65336 GIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID.
// Command runs a Composition function.
type Command struct {
CacheDir string `short:"c" help:"Directory used for caching function images and containers." default:"/xfn"`
Timeout time.Duration `help:"Maximum time for which the function may run before being killed." default:"30s"`
MapRootUID int `help:"UID that will map to 0 in the function's user namespace. The following 65336 UIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID." default:"100000"`
MapRootGID int `help:"GID that will map to 0 in the function's user namespace. The following 65336 GIDs must be available. Ignored if xfn does not have CAP_SETUID and CAP_SETGID." default:"100000"`
Image string `arg:"" help:"OCI image to run."`
FunctionIO []byte `arg:"" help:"YAML encoded FunctionIO to pass to the function." type:"filecontent"`
}
Yes that's exactly the problem!
Is there a way to instruct Kong to only accept a single argument for a []byte field?
If you use kong.FileContentFlag as the type it'll correctly identify it and not add the "..." - it's an alias for []byte.
I am also confused what is the difference between filecontent and kong.FileContentFlag? Currently it looks the same, but filecontent appends .... So I assumed that filecontent works with string then, but this is also not the case?
I suggest filecontent is made to work with string field while kong.FileContentFlag is used when you need []byte field. Then also there will be no issue with ....