1.1.0 • Published 11 months ago

primitivist v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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

1.1.0

11 months ago

1.0.1

11 months ago

1.0.0

2 years ago