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

pykms_Client fails to parse command line options correctly #113

Open
sborrill opened this issue May 28, 2024 · 3 comments
Open

pykms_Client fails to parse command line options correctly #113

sborrill opened this issue May 28, 2024 · 3 comments
Labels
bug Something isn't working confirmed Okay, we can reproduce it! documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@sborrill
Copy link

When specifying a positional argument, using the -m flag appears to read the wrong parameter:

% python3.11 pykms_Client.py -m Windows10 192.168.10.1
optional py-kms client argument -m: expected one argument, unrecognized: '192.168.10.1'. Exiting...

@simonmicro
Copy link

Wrong way around:

python3 pykms_Client.py 192.168.10.1 -m Windows10

First the positional arguments, then the optional ones.

@simonmicro simonmicro closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
@sborrill
Copy link
Author

This contradicts the documentation (and also every other *nix utility). Note that --help shows the options should come before the positional arguments as is conventional:

% python3.11 pykms_Client.py --help

py-kms: KMS Client Emulator written in Python
---------------------------------------------

usage: pykms_Client.py [-m {WindowsVista,Windows7,Windows8,Windows8.1,Windows10,Office2010,Office2013,Office2016,Office2019}] [-c CMID] [-n MACHINE] [-t0 TIMEOUTIDLE] [-t1 TIMEOUTSNDRCV] [-y]
                       [-V {CRITICAL,ERROR,WARNING,INFO,DEBUG,MININFO}] [-F LOGFILE [LOGFILE ...]] [-S LOGSIZE] [-D DISCOVERY] [-h]
                       [ip] [port]

@simonmicro
Copy link

Hmm, this is indeed strange! The help being wrong is really strange, as that part should come 1:1 from argparse, although the original author did quite some magic with combining multiple sub-parsers. Idk, I think I'll reopen this to either fix the documentation or the command argument order (I think the first will be better for compatibility).

If anybody wants to take a shot at this, please go ahead!

@simonmicro simonmicro reopened this May 30, 2024
@simonmicro simonmicro added bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed confirmed Okay, we can reproduce it! labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed Okay, we can reproduce it! documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants