Skip to content

Forwarding arguments? #87

@tonyb983

Description

@tonyb983

I'm not sure if this feature would be useful or necessary at all, and honestly this may just stem from my bash inexperience, but I'm having trouble forwarding (if this is the correct expression) arguments to a command that is run by mask.

For simplicity sake, say you are building a binary with cmake and attempting to run the output:

Binary usage is such:
$ ./HelloWorld -n <NAME> -l <LANG>

My mask script looks like this:

## standalone

> Builds and runs the standalone executable (cli) portion of the project

**OPTIONS**
* run
    * flags: -r --run
    * type: boolean
    * desc: Run the standalone executable after building

* args
    * flags: -a --args
    * type: string
    * desc: The args to pass to the executable when it is run (flag will be ignored if run is not also passed). If not provided the default will be '--help'.

```bash
INPUT_ARGS=${args:-"--help"}
cmake -S standalone -B build/standalone
cmake --build build/standalone

[[ "$run" == "true" ]] && ./build/standalone/HelloWorld $INPUT_ARGS
\```
(^ Ignore this backslash, it was the only way I could get this block to close)

But I'm getting errors from Mask regarding unexpected arguments (-n flag):

$ mask standalone -r -a "-n Tony"
error: Found argument '-n' which wasn't expected, or isn't valid in this context

USAGE:
    mask standalone --args <args> --run

For more information try --help

Please let me know if I'm doing something wrong or if this is indeed expected behavior, and whether there can be option to forward remaining args "inside" the mask command.

Edit: Sorry for the edit, I fat fingered control + enter to submit this too soon.
Edit2: I'm bad at formatting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions