statcode
statcode copied to clipboard
Options do not work.
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.
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