runner icon indicating copy to clipboard operation
runner copied to clipboard

positional argument propagation?

Open AlJohri opened this issue 6 years ago • 3 comments

I don't want to specify multiple tasks on the CLI, just a single task at a time. For me, &&, is sufficient for running multiple tasks.

Instead, I want full ARG propagation. For example, I want to be be able to run:

runner lab notebooks/test.ipynb --debug

where the task_lab is defined as simply propagating the entire "$@" to jupyter lab with some default options already set.

Is this possible? I get an error saying the notebooks/test.ipynb task doesn't exist so its presumably thinking each positional argument is a task.

AlJohri avatar Jan 10 '20 19:01 AlJohri

its presumably thinking each positional argument is a task.

Correct.

It only propagates arguments that begin with a dash. Can't suggest any workaround, because Runner CLI simply wasn't designed for this, and it will all be hacky. You can roll your own argument parser instead of using Runner CLI.

You may also take a look at the future version in the next branch. Although it's a work in progress, the core idea is that everything is DIY, and it has a huge library of helper functions which you can copy/include and use in your own launcher/build script, in your case, this file: https://github.com/stylemistake/runner/blob/next/lib/argparse.sh

stylemistake avatar Jan 10 '20 19:01 stylemistake

Cool, thanks! Will the next version by any chance allow disabling task chaining to allow for full argument propagation?

AlJohri avatar Jan 15 '20 03:01 AlJohri

Yeah, I'll take it into consideration.

stylemistake avatar Jan 15 '20 11:01 stylemistake