lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.07k stars 58 forks source link

fix: add missing option to cli #91

Closed jmcantrell closed 3 weeks ago

jmcantrell commented 3 years ago

The main module is already expecting a clear option to be passed to it, but the cli module was not exposing it to the user.

I found this because I was hoping to add the option to disable clearing the screen. Turns out it was already there, just not in cli.js.

I wasn't sure about where the option should be in the list, the description text, or whether to add a short option, so I just added the bare minimum. Feel free to change it to suit your style.

jmcantrell commented 3 years ago

I just realized this option still gets passed even though it's not mentioned in cli.js, so this is really just a documentation issue.

akauppi commented 3 years ago

@jmcantrell Is this now moot that sirv has --no-clear option and the author has explicitly told (somewhere) that it's not to be documented. I.e. with the CLI it always clears. Unless you know how to switch it off. :)

I'm fine with that.

jmcantrell commented 3 years ago

@akauppi As long as I can use --no-clear, I'm not terribly concerned that it's not documented. I just thought the author might be unaware of that. I am curious why it's purposefully not documented though. Do you have any idea or know where the author mentioned it?

OJFord commented 3 years ago

@jmcantrell Here: https://github.com/lukeed/sirv/issues/58#issuecomment-651314386

I think just out of reluctance for it to exist at all. It is frustrating though, because I don't use sirv that often (i.e. not through work) so almost every time I forget about --no-clear, am annoyed by the 'clear' behaviour, and end up back here about to open an issue only to re-discover #58.