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
## 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=?)
##
show_error() {
@ -125,9 +124,6 @@ parse_options() {
known_option_name=${known_option%=$known_option_var}
# Short option
if [[ "$option" = "$known_option_name" ]]; then
# Short option
if [[ "$option" = "$known_option_name" ]]; then
option_value="yes"
known_option_var=$(echo "$known_option_var" | tr "-" "_")
eval "$known_option_var=\"$option_value\""
@ -164,8 +160,6 @@ parse_options() {
done
# Unknown option
if [[ -z "$option_value" ]]; then
# Unknown option
if [[ -z "$option_value" ]]; then
option=${option%%=*}
[[ "$option" = \?* ]] && option=${option#*\?}
show_error "unrecognized option -$option"
@ -180,5 +174,3 @@ parse_options() {
done
}
parse_options "$@"

View File

@ -1,5 +1,4 @@
https://github.com/renatosilva/easyoptions
EasyOptions is distributed under the terms of the New BSD License (3-clause): Copyright (c) 2013, 2014 Renato Silva
https://github.com/renatosilva/easyoptions 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
following conditions are met:
* 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
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.