primitivist

1.1.0 • Public • Published

primitivist

an options parser for bash scripts based on minimist.

example

eval "$(primitivist -B foo -B bar -S baz -- --foo --baz quux a b c)"

echo "${HELP}"  # empty string
echo "${FOO}"   # 1
echo "${BAR}"   # empty string
echo "${BAZ}"   # quux
echo "${_}"     # (a b c)

cli

primitivist takes two options, --boolean (short: -B) and --string (short: -S), which map to their meanings in minimist. parsing stops early when an unexpected parameter occurs (ie, stopEarly: true), and remaining arguments are passed to a second minimist parse with the configured boolean and string fields.

testing

I have a simple test in ./test.sh. it should cover the basics

license

MIT

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i primitivist

    Weekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    6.08 kB

    Total Files

    8

    Last publish

    Collaborators

    • jfhbrook