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

Options do not work. #21

Open
mario-grgic opened this issue Dec 17, 2018 · 1 comment
Open

Options do not work. #21

mario-grgic opened this issue Dec 17, 2018 · 1 comment

Comments

@mario-grgic
Copy link

I'm using Python 3.7.0 on macOS 10.14.2 and none of the options works. For example:

statcode -a just prints usage. statcode --list also. statcode -n 404 says "Sorry, statcode does not recognize: -n". But it prints it in usage message as valid option.

@Malex
Copy link
Contributor

Malex commented Feb 25, 2019

Maybe the help is not specific enough, but since I implemented that part, I can answer:
Since statcode handles both status codes as well as headers, the all options wouldnt make much sense without a specifier, since listing statuses and headers together is a bit confusing.
If you read the usage it explicity says:
-a,-l, --all,--list statucode prints all codes in compact version
-a,-l, --all,--list headers prints all headers in compact version

the correct syntax is statcode -a statuscode for statuses, headers otherwise. I think it's correct it prints usage if the usage is not correct
https://github.com/shobrook/statcode/blob/master/statcode/statcode.py#L332

As to your other question, I've not ever seen that option before, was implemented by someone else, but looking at the code at line
https://github.com/shobrook/statcode/blob/master/statcode/statcode.py#L335
the -n is an option you add after the command, not before, so go for statcode 404 -n

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