# Rewrote Command Line Argument Handling

> Source: <https://www.dotnetperls.com/2026_9_30_rewrote-command-line-arguments>
> Published: 2026-09-30 07:00:00+00:00

My **Rust program** used the `clap` crate to handle command line arguments, and it worked well. But I wanted to try using an LLM to **generate some custom code** to replace it, to see if there would be any performance improvements or reductions in bloat.

I wrote a 120-line **spec**, complete with examples, in **Markdown**, and set **Gemini 3.8 Flash** (on OpenRouter) to implementing the code. The first time, I forgot an argument, so I had to generate it twice. Each generation cost me about $0.02, so it was affordable.

Some **observations**:

• Removing `clap` from my program reduced the compiled executable file size by 300 kB, and reduced the time required in argument parsing from 20 microseconds to about 1 microsecond.

• My vibe-coded replacement function does not handle edge cases as well, but it handles all the important command line arguments I needed.
