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

Add custom usage message #42

Closed
KevinHock opened this issue May 9, 2017 · 1 comment · Fixed by #48
Closed

Add custom usage message #42

KevinHock opened this issue May 9, 2017 · 1 comment · Fixed by #48
Assignees
Labels

Comments

@KevinHock
Copy link
Collaborator

KevinHock commented May 9, 2017

So my bad, I missed this bug when I made the change to run it with -m, but the default argparse usage message no longer fits with how the program should be run. (It says to run '_ main _.py')

python3.5 -m pyt example/vulnerable_code/sql/sqli.py

usage: __main__.py [-h] (-f FILEPATH | -gr GIT_REPOS) [-pr PROJECT_ROOT] [-d]
                   [-o OUTPUT_FILENAME] [-csv CSV_PATH] [-p | -vp]
                   [-t TRIGGER_WORD_FILE] [-l LOG_LEVEL] [-a ADAPTOR] [-db]
                   [-dl DRAW_LATTICE [DRAW_LATTICE ...]] [-li | -re | -rt]
                   [-intra] [-ppm]
                   {save,github_search} ...
__main__.py: error: invalid choice: 'example/vulnerable_code/sql/sqli.py' (choose from 'save', 'github_search')

Hopefully it's something simple like http://stackoverflow.com/questions/21185526/custom-usage-function-in-argparse

@KevinHock
Copy link
Collaborator Author

KevinHock commented May 31, 2017

Wth the above PR it now does

python -m pyt example/vulnerable_code/sql/sqli.py

usage: python -m pyt [-h] (-f FILEPATH | -gr GIT_REPOS) [-pr PROJECT_ROOT]
                     [-d] [-o OUTPUT_FILENAME] [-csv CSV_PATH] [-p | -vp]
                     [-t TRIGGER_WORD_FILE] [-l LOG_LEVEL] [-a ADAPTOR] [-db]
                     [-dl DRAW_LATTICE [DRAW_LATTICE ...]] [-li | -re | -rt]
                     [-intra] [-ppm]
                     {save,github_search} ...
python -m pyt: error: invalid choice: 'example/vulnerable_code/sql/sqli.py' (choose from 'save', 'github_search')

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

Successfully merging a pull request may close this issue.

1 participant