Simple C Command Line Parser

I’ve been feeling a little overwhelmed by the languages I generally code in (C#, C++, Rust) and wanted to get my teeth into something a bit simpler again (obviously C!). One thing I’ve never been that happy with in C was the lack of a good command line argument parser. There is a great list of option parsers that @nothings has curated over the years, but most of them are C++, and the ones for C are just a bit underwhelming to me.

utest.h Now Supports Whole Program Optimization

A user of utest.h posted an intruiging issue that on an release build with Visual Studio my unit testing framework for C/C++, utest.h, no tests were being ran. But on a debug build they were. Before I even got to the issue they worked out that whole program optimization was causing the issue and closed it themselves. But this got me thinking - there is no reason why my library shouldn’t work with whole program optimization enabled, so why was this behaving badly?

How to Test Rust Command Line Applications

Testing command line applications in Rust is something that I found was a bit of a grey area. The main documentation for Rust has a section Testing CLI applications by running them which explains how they suggest you test command lines applications: use std::process::Command; // Run programs use assert_cmd::prelude::; // Add methods on commands use predicates::prelude::; // Used for writing assertions #[test] fn file_doesnt_exist() -> Result<(), Box<std::error::Error>> { let mut cmd = Command::cargo_bin("grrs")?

Fixed Up RSS

One thing I’ve unfortunately neglected for a little while now on my blog was the RSS feed - mostly because I didn’t have a clue how to make Hugo do it as I’d like. There was a couple of issues: Only the summaries of my posts were fed via RSS - not the full contents. I do not do any sort of content tracking on my site because I don’t want to foist vaporware like Google Analytics on my readers, so it really doesn’t matter to me whether people read my content from the RSS feed or from the main site - that they read it is enough!

Lessons of a Remote Worker

Jumping into cold water is always a shocking experience. Being able to calm yourself, acclimatise to the temperature of the water - before you attempt to swim is how you survive. A ton of people worldwide have just plunged into the icy water of working from home, and since I’ve been doing this for six years I have some advice from the good and the bad of what I learned over the time.