Correct typo, bad copy/paste

This commit is contained in:
dig 2018-06-29 15:56:03 +02:00
parent 28f940ccda
commit 99e039dbc3
2 changed files with 14 additions and 24 deletions

View File

@ -36,7 +36,6 @@
## For better speed, you may want to define the options in source code yourself, so they do not need to be parsed from the documentation. The side effect is ## For better speed, you may want to define the options in source code yourself, so they do not need to be parsed from the documentation. The side effect is
## that when changing them, you will need to update both the documentation and the source code. You define the options statically like this: ## that when changing them, you will need to update both the documentation and the source code. You define the options statically like this:
## ##
##
## options=(o=option some-boolean some-value=?) ## options=(o=option some-boolean some-value=?)
## ##
show_error() { show_error() {
@ -123,9 +122,6 @@ parse_options() {
for known_option in "${options[@]}" "${short_option_vars[@]}"; do for known_option in "${options[@]}" "${short_option_vars[@]}"; do
known_option_var=${known_option#*=} known_option_var=${known_option#*=}
known_option_name=${known_option%=$known_option_var} known_option_name=${known_option%=$known_option_var}
# Short option
if [[ "$option" = "$known_option_name" ]]; then
# Short option # Short option
if [[ "$option" = "$known_option_name" ]]; then if [[ "$option" = "$known_option_name" ]]; then
option_value="yes" option_value="yes"
@ -163,8 +159,6 @@ parse_options() {
fi fi
done done
# Unknown option # Unknown option
if [[ -z "$option_value" ]]; then
# Unknown option
if [[ -z "$option_value" ]]; then if [[ -z "$option_value" ]]; then
option=${option%%=*} option=${option%%=*}
[[ "$option" = \?* ]] && option=${option#*\?} [[ "$option" = \?* ]] && option=${option#*\?}
@ -180,5 +174,3 @@ parse_options() {
done done
} }
parse_options "$@" parse_options "$@"

View File

@ -1,5 +1,4 @@
https://github.com/renatosilva/easyoptions https://github.com/renatosilva/easyoptions EasyOptions is distributed under the terms of the New BSD License (3-clause): Copyright (c) 2013, 2014 Renato Silva
EasyOptions is distributed under the terms of the New BSD License (3-clause): Copyright (c) 2013, 2014 Renato Silva
<br.renatosilva@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the <br.renatosilva@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met: following conditions are met:
* Redistributions of source code must retain the above copyright * Redistributions of source code must retain the above copyright
@ -15,4 +14,3 @@ COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE. OF SUCH DAMAGE.