rednafi / httpurr

ᗢ HTTP status codes on speed dial
MIT License
20 stars 2 forks source link

Idea: httpurr -list [category #] #8

Closed christophberger closed 1 year ago

christophberger commented 1 year ago

Idea: optionally filter the list by category (1xx, 2xx, 3xx,...)

httpurr -list 4

would then list all 4xx codes.

rednafi commented 1 year ago

Thanks for the idea. I like this one. However, I'm leaning towards httpurr -list -cat 4 since it's explicit and communicates the intent better.

christophberger commented 1 year ago

It would be more typing and a flag that depends on another one.

But the intent would indeed be clearer that way.

Or maybe httpurr -list cat4?

rednafi commented 1 year ago

Ended up going with this:

httpurr -list -cat 4

It returns:


ᗢ httpurr
==========

Status Codes
------------

------------------ 4xx ------------------

400    Bad Request
401    Unauthorized
402    Payment Required
403    Forbidden
...

True, it's a bit extra typing but still not too bad. The tests cover the behavior of the dependent flags; so it shouldn't be much of an issue. Released with v0.1.1. Thanks much.