Posts

Showing posts with the label cli

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 ...

A basic Upstart Events GUI (and cli!:-) tool

Image
It didn't quite make it into the release, but we now have a very basic Upstart GUI that should appear in Ubuntu along with the Upstart 1.7 release soon. What is it? upstart-monitor is a simple application that shows Upstart events as they are emitted. It can be used to view both system-level events and also session-level events when Upstart is running as a Session Init. It requires Upstart 1.7. What can I use it for? The tool allows you to see events as they occur which is an aid to understanding. It also helps with writing new jobs since, if you are not sure which event to use, provoke the scenario you want, then just copy the appropriate event that appears in upstart-monitor to your .conf file (more details on this in a future post...). How do I use it? Just start it to see events being emitted: If you'd prefer a command-line version, run it with the ' -n ' option: Where can I get it? If you can't wait for it to land in Ubuntu, you ca...