blarg

A basic little argument parser

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Installation

nimble install blarg
choosenim install blarg
git clone https://github.com/squattingmonk/blarg

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
blarg - - - - - - -

Source

Repository https://github.com/squattingmonk/blarg
Homepage https://github.com/squattingmonk/blarg
Registry Source nimble_official

README

blarg

A basic little argument parser for command-line tools.

Forked from cligen's parseopt3 module.

Requirements

Installation

$ nimble install blarg

or...

$ git clone https://github.com/squattingmonk/blarg.git
$ cd blarg
$ nimble install

Usage

In most cases, blarg can be used as a drop-in replacement for std/parseopt:

import blarg

for kind, key, val in getopt():
  case kind
  of cmdArgument:
    echo "got argument ", key
  of cmdShortOption, cmdLongOption:
    echo "got option ", key, " = ", val
  else:
    assert false # Cannot happen

For detailed usage, see the docs.

Features

  • Separator characters may be required or optional, and may be customized. If optional, short or long options that do not expect a value must be specified in shortNoVal and longNoVal respectively.
  • Supports operator characters before separators (e.g., --foo+=bar)
  • Supports -- and custom stop words, which treat any following options as arguments.
  • Stop words and long options that do not expect a value can be normalized (e.g., normalizing with strutils.normalize makes --foobar match --fooBar). The normalizing proc is optional and customizable, unlike cligen/parseopt3.

TODO

  • Add more examples for advanced usage