Posts

Showing posts with the label command-line

rout is out

I’ve just released the rout tool I mentioned in my last blog post about command-line parsing semantics . rout is a simple tool, written in rust, that produces unicode utf-8 output in interesting ways. It uses the minimal command-line parsing crate ap . It also uses a fancy pest parser for interpreting escape sequences and range syntax. Either grab the source , or install the crate : $ cargo install rout Full details (with lots of examples! ;) are on both sites: https://crates.io/crates/rout https://github.com/jamesodhunt/rout

Can you handle an argument?

TL;DR This post explores some of the darker corners of command-line parsing that some may be unaware of. You might want to grab a coffee. Intro No, I’m not questioning your debating skills, I’m referring to parsing command-lines! Parsing command-line option is something most programmers need to deal with at some point. Every language of note provides some sort of facility for handling command-line options. All a programmer needs to do is skim read the docs or grab the sample code, tweak to taste, et voila! But is it that simple? Do you really understand what is going on? I would suggest that most programmers really don’t think that much about it. Handling the parsing of command-line options is just something you bolt on to your codebase. And then you move onto the more interesting stuff. Yes, it really does tend to be that easy and everything just works… most of the time. Most? I hit an interesting issue recently which expanded in scope somewhat. It might raise an eyebrow for ...

procenv now in Debian and Ubuntu: how you can use it

The procenv utility covered in a previous post is now at version 0.15 and also available in Debian Sid and Ubuntu Raring . So, you can do the usual " sudo apt-get install procenv " followed by simply " procenv " to run it. However, due to the way this utility is built, there is a little more you can do. Read on... procenv runs itself as part of its build (at the end of course :-). What this means is that you can now see what that build environment is like by looking at the build logs: Debian build logs Ubuntu build logs (you need to expand the "twistie" to see the log files. If you haven't already heard, for the Ubuntu Raring cycle, autopkgtest ( DEP-8 ) tests -- where package builds automatically trigger tests that run on an environment very similar to a "normal" system -- are a hot topic. procenv is DEP-8 enabled, so again, we get to see exactly what such an autopkgtest environment provides . With this information, you can...