Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dickeytk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
23 ms
·
241.
▲
by
dickeytk
8y ago
Well first of all the docs say it's for "diagnostic output" http://pubs.opengroup.org/onlinepubs/9699919799/functions/st... not "errors". Secondly, it doesn't matter what's
242.
▲
by
dickeytk
8y ago
factor #4 in my article: https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46
243.
▲
by
dickeytk
8y ago
stderr is not for errors! (at least, not necessarily) It's for messaging things to the user. These are often errors, but there are some examples like curl that use stderr for progress. Leave it up to the CLI to decide what colors to us
244.
▲
by
dickeytk
8y ago
you mean a psychologist I think
245.
▲
by
dickeytk
8y ago
How can you say it's less universal when it doesn't work on windows?
246.
▲
by
dickeytk
8y ago
NO IT WON'T HANG. I give up. I don't know how else to try to explain this to you.
247.
▲
by
dickeytk
8y ago
appreciate the clarification!
248.
▲
by
dickeytk
8y ago
Like for the confirmation example? I agree. It would help clear this up. The points people are raising here with prompting are definitely not issues, they're just misunderstanding my point.
249.
▲
by
dickeytk
8y ago
This scenario would only happen if a flag became required. Prompting or not it would still be an issue. (And it wouldn't prompt as this is a non-tty environment)
250.
▲
by
dickeytk
8y ago
You get false positives sometimes (where it claims to not be a tty but is going to the screen), but because the fall back is just reduced functionality it never causes any issues. We make hundreds of checks like this for tty in the CLI
251.
▲
by
dickeytk
8y ago
Correct, and if stdin is not a tty it should error out instead of prompting
252.
▲
by
dickeytk
8y ago
That's what the error code is for
253.
▲
by
dickeytk
8y ago
perhaps I should've called this out explicitly, but yes, I would expect a CLI to do this. I have future plans for oclif to take this a step further and make the help contextual based on what you're working with. For example, if yo
254.
▲
by
dickeytk
8y ago
red, yellow, green, cyan, and magenta are pretty safe. We've had complaints about others, but these are pretty reliable in my experience. dim is safe too, but doesn't work all the time. (Not working meaning just not dimmed)
255.
▲
by
dickeytk
8y ago
we use https://github.com/mikaelbr/node-notifier
256.
▲
by
dickeytk
8y ago
If the man pages are simply generated from the help output, why bother having them when you can just use `--help`?
257.
▲
by
dickeytk
8y ago
You could have a `--full` or `--verbose` flag on the help command to display the full output. That will work on Windows as well.
258.
▲
by
dickeytk
8y ago
Yeah if I get some time I should expand on that. There are some colors that don't work well at all for common scenarios (solarized, windows). Some of them we've blacklisted and do not use. Also for colors it's good to try to
259.
▲
by
dickeytk
8y ago
yes, exactly. I think being verbose and more human friendly is a much better way to design a tool than being terse and machine friendly. Ultimately all we're doing is trying to save human time anyways.
260.
▲
by
dickeytk
8y ago
A few things to unpack here. First, this is just an example. A real world scenario would be something domain specific. Maybe I could come up with a better contrived example here. Still, conceivably the app could check the file owner before
261.
▲
by
dickeytk
8y ago
I feel the synopsis section of man pages often just becomes a bunch of useless garbage above the fold (for instance, look at `man git`). Using it less as a complete docopts kind of thing and more of multiple common usages (like `man tar` an
262.
▲
by
dickeytk
8y ago
For people that like man pages (there appears to be lots of you) do you think that man pages are more important than web or in-cli docs? Or just that they should be written in addition to and not missed out on? My (current) position is th
263.
▲
by
dickeytk
8y ago
I am having an impossible time verifying this, but I recall reading that MacOS deletes unaccessed files eventually from `~/Library/Caches/*`. Which would be a compelling reason to use that for cache. (Not being able to verify
264.
▲
by
dickeytk
8y ago
Oh believe me. I'm intimately familiar with proxies and CLI apps. I think that might be a good standalone article though as it only applies to CLIs that connect to APIs whereas this article is intended for all CLIs, period. (Minus that
265.
▲
by
dickeytk
8y ago
Thank you for the great feedback!
266.
▲
by
dickeytk
8y ago
In practice I've had overwhelming feedback praising our use of spinners in the Heroku CLI and not a single complaint I can think of. In fact, I've had more praise for adding spinners and color than any other change we've put
267.
▲
by
dickeytk
8y ago
I just picked `ls` as it's a common utility everyone understands and isn't some contrived example using `cat`. I am going to add a note about `ls`'s behavior with isatty. It's sort of conflating a couple of things, but I
268.
▲
by
dickeytk
8y ago
The fact they don't run on windows means some subset of your users cannot even use them if they wanted to. Better to spend your time on something they can all read. I'm not saying they're not useful. If you've got plenty
269.
▲
by
dickeytk
8y ago
I may try to expand on this in the article, but it's in there if you read between the lines. There is a difference between something that takes in multiple args of the same type and multiple TYPES of args. I'm arguing against mult
270.
▲
by
dickeytk
8y ago
I almost want to rewrite the help section to encourage examples even more. They're incredibly valuable. I hadn't considered this before you mentioned it, but oclif CLIs could integrate to tldr pretty well. It already supports arra
More ›