http-server
http-server copied to clipboard
Add --no-verbose CLI option
Please ensure that your pull request fulfills these requirements:
- [x] The pull request is being made against the
masterbranch - [x] Tests for the changes have been added (for bug fixes / features)
What is the purpose of this pull request? (bug fix, enhancement, new feature,...)
Add a option to prevent showing all the request info, but show the basic info.
fixes #532
fixes #381
What changes did you make?
Add --no-verbose option
Provide some example code that this change will affect, if applicable:
N/A
I'm not sure of the usefulness of this option. The info is already shown by default, and will be the only output before any requests are made (providing the clickable link in some terminal emulators, as mentioned in the linked issues). And then there is already --silent to suppress all logging. What is the additional benefit of this "sort-of-silent" option?
The use-case is this: spawning a dev server for folks in scaffolded projects, many developers don't know what port http-server was spawned on (especially if it auto-selected a free port). That makes the URL output immensely valuable, since otherwise you have to know that the default is 8080 and it uses an incrementing search to find free ports.
However, verbose request logging for a development server is not workable: it interlaces request logs with far more important information, like build information and errors. There are many cases where request logging is unnecessary, yet where the display of a server's listen() address is still important.
For use in scaffolding, would it be sufficient to have the scaffold pass a predetermined port into http-server and tell the user that port?
This pull request has been inactive for 360 days
I think I've come round on this change, and I'm down to review it, but a few things first:
- [ ] fix merge conflicts and merge master
- [ ] add documentation:
- [x]
--helpoutput - [x] README.md
- [ ] doc/http-server.1
- [x]