Posts about Scripting

Building a well documented command line interface is hard. Learn how to take advantage of Go and Kingpin to produce a user friendly command line tool with Bash and Zsh completion.

Semantic versioning (semver) is a scheme for version numbers. It also specifies how changes in version numbers should convey meaning about the underlying code and what has been modified from one version to the next. As useful as that is many developers are unaware that semver can be easy to maintain with the right tools.

Do you write a lot of command-line tools? I've written them in C, Java, C#, Ruby, and most recently Python. I looked at the standard `argparse` library in Python. But here I was learning yet-another-argument-parser-library. After a little research, I discovered docopt works in many languages. Here's why docopt has become my favorite tool for argument parsing.

I've written hundreds of Bash scripts over my career, but I still suck at Bash. I have to look up the syntax for simple logical structures every single time. If I want to do anything fancy with curl or sed, I have to go and look up man pages too. I spend hours brute forcing every possible combination of single and double quotes and escaping and double-escaping every character in my regular expressions until I get something that looks like abstract ASCII art, all while trying to remember the difference between grep and perl regular expressions.