FCP-INDI / cpac

A convenience wrapper for https://github.com/FCP-INDI/C-PAC that provides a simple command line interface.
https://fcp-indi.github.io/docs/latest/user/cpac
MIT License
4 stars 3 forks source link

🐛 `-o` / `--container_option` does not work as expected #18

Open shnizzedy opened 2 years ago

shnizzedy commented 2 years ago

Describe the bug

The option is listed in the README as

  -o [OPT [OPT ...]], --container_option [OPT [OPT ...]]
                        parameters and flags to pass through to Docker or Singularity

                        This flag can take multiple arguments so cannot be
                        the final argument before the command argument (i.e.,
                        run or any other command that does not start with - or --)

defined here https://github.com/FCP-INDI/cpac/blob/46af66edfaf8547a5eb79016d9cdd8c3e25ae13a/src/cpac/__main__.py#L74-L83

but I don't see that parameter handled anywhere screenshot of GitHub search for "container_option"

Passing options through don't seem to work with any syntax I've attempted (see "To reproduce" below).

To reproduce

cpac -o --entrypoint=/bin/bash --platform docker run

cpac: error: argument -o/--container_option: expected one argument

cpac -o "--entrypoint=/bin/bash" --platform docker run

cpac: error: argument -o/--container_option: expected one argument

cpac -o="--entrypoint=/bin/bash" --platform docker run

cpac run: error: the following arguments are required: bids_dir, output_dir, level_of_analysis, extra_args

cpac -o="--entrypoint=/bin/bash" --platform docker run bids_dir outputs_dir participant

run.py: error: unrecognized arguments: -o=--entrypoint=/bin/bash

Expected behavior

Any options passed to -o or --container_option are passed through to Docker or Singularity.

Acceptance criteria

cpac version

0.3.2.post1

C-PAC version

v1.8.1, v1.8.1-dev

Container platform

Docker, Singularity