Live data from Hacker News

Techniques I use to create a great user experience for shell scripts

nochlin.com

1–10 of 281 posts

Re: Techniques I use to create a great user experience for shell scripts

#2
I don’t remember where I got it, but I have a simple implementation of a command-line spinner that I use keyboard shortcuts to add to most scripts. Has been a huge quality of life improvement but I wish I could just as seamlessly drop in a progress bar (of course, knowing how far along you are is more complex than knowing you’re still chugging along).

Re: Techniques I use to create a great user experience for shell scripts

#6
post #2

I don’t remember where I got it, but I have a simple implementation of a command-line spinner that I use keyboard shortcuts to add to most scripts. Has been a huge quality of life improvement but I wish I could just as seamlessly drop in a progress bar (of course, knowing how far along you are is more complex than knowing you’re still chugging along).

can you share it?

Re: Techniques I use to create a great user experience for shell scripts

#9
post #8

Definitely don't check that a variable is non-empty before running rm -rf ${VAR}/* That's typically a great experience for shell scripts!

It happens to the best of us

https://github.com/ValveSoftware/steam-for-linux/issues/3671

Re: Techniques I use to create a great user experience for shell scripts

#10
post #5

Only one that’s shell specific is 4. The rest can be applied any code written. Good work!

Even 4 can be generalized to "be deliberate about what you do with a failed function call (etc) - does it exit the command? Log/print an error and continue? Get silently ignored? Handled?"
Post reply on HN