Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common arguments/options in ArgParse/pyAttributes #24

Open
umarcor opened this issue Apr 10, 2021 · 1 comment
Open

Common arguments/options in ArgParse/pyAttributes #24

umarcor opened this issue Apr 10, 2021 · 1 comment
Labels
pyHDLC Related to the Python helper utilities

Comments

@umarcor
Copy link
Member

umarcor commented Apr 10, 2021

Options/arguments for the CLI in pyHDLC are declared using pyAttributes. Option -n|--noexec is defined for Run as it is expected to be available for all (sub)commands. However, it does not work if placed after them. That is, the following does work:

# ./pyHDLC/cli.py -n build sim
· docker build --progress=plain --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg REGISTRY=ghcr.io/hdl/debian-buster -t ghcr.io/hdl/debian-buster/sim -f debian-buster/sim.dockerfile .

but the following fails:

# ./pyHDLC/cli.py build -n sim
usage: cli.py [-n] [-p] [-d] {help,build,push,pull} ...
cli.py: error: unrecognized arguments: -n

It would be desirable if -n was inherited by build and both orders were accepted.

@umarcor umarcor added the pyHDLC Related to the Python helper utilities label Apr 10, 2021
@Paebbels
Copy link
Member

Similar to how GHDL behaves, that's the behavior of Pythons ArgParse.
pyAttributes is a wrapper for ArgParse, so the behavior is inherited.

Anyhow, the described behavior would be nice.

@umarcor umarcor changed the title Common arguments/options in pyAttributes Common arguments/options in ArgParse/pyAttributes Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pyHDLC Related to the Python helper utilities
Projects
None yet
Development

No branches or pull requests

2 participants