Comments (3)
After digging around with curl for a while, I found that
It would be nice if httpstat did not depend on the position of the URL
is very hard to achieve. curl actually don't care the position of URL, whether URL is at first, or last, or in the middle, as long as the other arguments follow the rules, curl can parse the inputs correctly.
As to httpstat, we couldn't just pass all the arguments to curl directly, we have to find out the URL to decide whether to use http or https display template. Specify position is the easiest way to help getting the URL, if not specify, we have to implement an argument parser the same as curl's, which is not an easy work. In that case, whether the position is first or last doesn't make much difference, since both will still have invocation valid to curl but invalid to itself. What do you think?
from httpstat.
Thank you for the prompt reply. I think replicating curl
's command-line parsing or adding a library dependency would overkill. Nevertheless, I would suggest a comment making it clear to first-time users that the URL needs to be given first, because
curl --help
gives prints this usage:
curl [options...] <url>
- the
curl
manpage gives examples with options and URL in any order
Anyway, it is a minor issue or even just a matter of habit.
from httpstat.
Actually the usage has made it clear that the URL should be put at the first position:
$ python httpstat.py
Usage: httpstat URL [CURL_OPTIONS]
httpstat -h | --help
httpstat --version
The time I was considering the URL's position, I was thinking that httpstat itself actually has no option. So it should be distinguished from normal situation, where intuitively options are put after command and before the main arguments. Thus when you see httpstat URL [CURL_OPTIONS]
, it becomes very clear that the curl options are just for curl, and will definitely have no effect on how httpstat will perform. All the options for httpstat, are environment variables, separately.
In conclusion, the position of URL won't be changed, thanks for your suggestion and cooperation :)
P.S. it's easy to modify the code for your own to make URL at the last position, just change L180 to url = args[-1]
and L88 to curl_args = args[:-1]
.
from httpstat.
Related Issues (20)
- Merge with httpie HOT 2
- HTTP/2 Support HOT 1
- Upgrade curl to test HTTP2 HOT 1
- brew formula not found HOT 4
- Option to display the IP address used to contact destination HOT 6
- Provide Average based on number of attempts over time HOT 2
- Error when running on Linux/Python 2.6 HOT 2
- 'failed to create process' after PIP install - Possible Python 3 Compatibility Issue? HOT 4
- FileNotFoundError on WIN7/Python3.6.0, installed with Pip HOT 2
- Add option for detailing SSL/TLS Certificate HOT 5
- Snapcraft.yaml for httpstat HOT 1
- Windows color support using colorama
- Lamentable screenshot HOT 2
- Detecting connectivity Issues to the destination HOT 3
- server processing time is negative HOT 4
- 这是抄袭了https://github.com/davecheney/httpstat吗? HOT 2
- davecheney/httpstat says that this project is a shameless ripoff? why? HOT 1
- why server processing is 0 with local request HOT 5
- Ffffff
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpstat.