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

Commandline arguments and options are display twice #40

Open
mani-nesan opened this issue Mar 23, 2017 · 1 comment
Open

Commandline arguments and options are display twice #40

mani-nesan opened this issue Mar 23, 2017 · 1 comment

Comments

@mani-nesan
Copy link
Contributor

mani-nesan commented Mar 23, 2017

When I call

pt
//
usage: pt [-h] [-v] [-q] {a,i,t} ...
pt: error: too few arguments
usage: pt [-h] [-v] [-q] {a,i,t} ...
pt: error: too few arguments
//

pt -h
//
usage: pt [-h] [-v] [-q] {a,i,t} ...

Platinumial Peragro commandline tool

optional arguments:
-h, --help show this help message and exit
-v, --verbose Be verbose
-q, --quiet Hide most output

subcommands:
valid subcommands

{a,i,t} additional help
a Analyze a given file
i Inspect a given file or hash in store
t Transcode a given file
usage: pt [-h] [-v] [-q] {a,i,t} ...

Platinumial Peragro commandline tool

optional arguments:
-h, --help show this help message and exit
-v, --verbose Be verbose
-q, --quiet Hide most output

subcommands:
valid subcommands

{a,i,t} additional help
a Analyze a given file
i Inspect a given file or hash in store
t Transcode a given file`
//

Also this behaviour follows on other unfinished commands like pt a & pt t

Through debugging I found the cause of this problem in cli.py line 173,

args, options_args = parser.parse_known_args()

Is there any way to avoid this stdout display? I went through the argparse documentation, but can't able to find any solution!

@sueastside
Copy link
Contributor

The cause is indeed the parse_known_args, the arguments for the commandline are build dynamically based on the type and format of the asset in question, this unfortunately results in the second print for which I have yet to find a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants