Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ bashopts_process_args ## Example ```bash #!/bin/bash -e #!/bin/bash -ei # load the library . bashopts.sh Loading bashopts.sh +8 −1 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ bashopts_math_max() { echo $(($1>$2?$1:$2)) } bashopts_math_min() { echo $(($1<$2?$1:$2)) } bashopts_join_by() { local IFS="$1" shift Loading Loading @@ -304,7 +308,7 @@ bashopts_dump_value() { } bashopts_diplay_help() { local elts optargs_max_len=8 val dval local elts optargs_max_len=8 val dval ncol=$COLUMNS declare -A optargs for op in "${bashopts_optlist[@]}"; do elts=() Loading @@ -317,6 +321,9 @@ bashopts_diplay_help() { optargs[$op]="$(bashopts_join_by , ${elts[@]})$val" optargs_max_len=$(bashopts_math_max $optargs_max_len ${#optargs[$op]}) done ncol=${ncol:-160} optargs_max_len=$(bashopts_math_min $optargs_max_len $(( $ncol / 3 )) ) set +x echo echo "NAME:" echo " $bashopts_tool_name - $bashopts_tool_description" Loading example.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash -e #!/bin/bash -ei # load the library . bashopts.sh Loading test.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash -e #!/bin/bash -ei # Copyright 2017 Emeric Verschuur <emeric@mbedsys.org> # # Licensed to the Apache Software Foundation (ASF) under one Loading Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ bashopts_process_args ## Example ```bash #!/bin/bash -e #!/bin/bash -ei # load the library . bashopts.sh Loading
bashopts.sh +8 −1 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ bashopts_math_max() { echo $(($1>$2?$1:$2)) } bashopts_math_min() { echo $(($1<$2?$1:$2)) } bashopts_join_by() { local IFS="$1" shift Loading Loading @@ -304,7 +308,7 @@ bashopts_dump_value() { } bashopts_diplay_help() { local elts optargs_max_len=8 val dval local elts optargs_max_len=8 val dval ncol=$COLUMNS declare -A optargs for op in "${bashopts_optlist[@]}"; do elts=() Loading @@ -317,6 +321,9 @@ bashopts_diplay_help() { optargs[$op]="$(bashopts_join_by , ${elts[@]})$val" optargs_max_len=$(bashopts_math_max $optargs_max_len ${#optargs[$op]}) done ncol=${ncol:-160} optargs_max_len=$(bashopts_math_min $optargs_max_len $(( $ncol / 3 )) ) set +x echo echo "NAME:" echo " $bashopts_tool_name - $bashopts_tool_description" Loading
example.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash -e #!/bin/bash -ei # load the library . bashopts.sh Loading
test.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash -e #!/bin/bash -ei # Copyright 2017 Emeric Verschuur <emeric@mbedsys.org> # # Licensed to the Apache Software Foundation (ASF) under one Loading