Fixes #4 : Make cmdarg understand '--option=value|-o=value' syntax.

This commit is contained in:
2014-04-19 21:39:23 -07:00
parent 950d630c4d
commit 77e92fbfb5

23
tests/test_equals.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
source $(dirname ${BASH_SOURCE[0]})/../cmdarg.sh
function shunittest_test_equals_parsing_shortopt
{
cmdarg_purge
cmdarg 'x:' 'example' 'just an example'
set -x
cmdarg_parse -x=3
set +x
[[ ${cmdarg_cfg['example']} -eq 3 ]] || return 1
}
function shunittest_test_equals_parsing_longopt
{
cmdarg_purge
cmdarg 'x:' 'example' 'just an example'
set -x
cmdarg_parse --example=3
set +x
[[ ${cmdarg_cfg['example']} -eq 3 ]] || return 1
}