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

Allow combining short arguments in CLI argument parser #25

Closed
covert-encryption opened this issue Nov 26, 2021 · 0 comments · Fixed by #32
Closed

Allow combining short arguments in CLI argument parser #25

covert-encryption opened this issue Nov 26, 2021 · 0 comments · Fixed by #32
Labels
beginner task A good way to become a developer enhancement New feature or request help wanted Extra attention is needed

Comments

@covert-encryption
Copy link
Owner

Here is a little task for anyone interested in helping. Our current implementation does not allow combining the single-hyphen arguments like

covert enc -A -r recipient1 -r recipient2 -p

into

covert enc -Arrp recipient1 recipient2

as might be excepted of standard UNIX practices. Have a look at the current implementation and get hacking :)

We no longer use the Python argparse module due to its many limitations that affect usability but the custom parser is quite simple and it should be easy to add this functionality. Usability is very important and these details make it a bit easier to accomplish common tasks.

Long arguments like --recipient are not to be combined, and any args taking parameters (like -r but unlike -A and -p) should consume each argv element directly following them as argument parameters rather than as other arguments, even if those begin with hyphens. The other common form used in some UNIX tools -rrecipient1 is not to be supported. Separation by space keeps it simple and clean, and works better with tab completion of filenames.

If further interested and if you are familiar with pytest, add tests for the argument parsing in tests/test_cli_arguments.py

Any help on this or other details is highly appreciated and your name will be mentioned in the release notes.

@covert-encryption covert-encryption added enhancement New feature or request help wanted Extra attention is needed beginner task A good way to become a developer labels Nov 26, 2021
covert-encryption pushed a commit that referenced this issue Dec 2, 2021
Instead of `-A -r recipient1 -r recipient2` you can now write `-Arr recipient1 recipient2`.

Fixes #25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner task A good way to become a developer enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant