forked from agriffis/ghettopt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update example.bash to pure-getopt 1.4.4
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,9 +224,9 @@ ghettopt() { | |
getopt() { | ||
# pure-getopt, a drop-in replacement for GNU getopt in pure Bash. | ||
# version 1.4.2 | ||
# version 1.4.4 | ||
# | ||
# Copyright 2012-2018 Aron Griffis <[email protected]> | ||
# Copyright 2012-2020 Aron Griffis <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining | ||
# a copy of this software and associated documentation files (the | ||
|
@@ -259,7 +259,7 @@ getopt() { | |
# "options -- parameters" on stdout. | ||
declare parsed status | ||
declare short long name flags | ||
declare short long='' name flags='' | ||
declare have_short=false | ||
# Synopsis from getopt man-page: | ||
|
@@ -282,7 +282,7 @@ getopt() { | |
# First parse always uses flags=p since getopt always parses its own | ||
# arguments effectively in this mode. | ||
parsed=$(_getopt_parse getopt ahl:n:o:qQs:TuV \ | ||
alternative,help,longoptions:,name,options:,quiet,quiet-output,shell:,test,version \ | ||
alternative,help,longoptions:,name:,options:,quiet,quiet-output,shell:,test,version \ | ||
p "$@") | ||
status=$? | ||
if [[ $status != 0 ]]; then | ||
|
@@ -344,7 +344,7 @@ getopt() { | |
return 4 ;; | ||
(-V|--version) | ||
echo "pure-getopt 1.4.2" | ||
echo "pure-getopt 1.4.4" | ||
return 0 ;; | ||
(--) | ||
|
@@ -589,7 +589,7 @@ getopt() { | |
# status 2.) If there is no match at all, prints a message on stderr | ||
# and returns 2. | ||
declare a q="$1" | ||
declare -a matches | ||
declare -a matches=() | ||
shift | ||
for a; do | ||
if [[ $q == "$a" ]]; then | ||
|
@@ -632,7 +632,7 @@ getopt() { | |
_getopt_quote() { | ||
# Quotes arguments with single quotes, escaping inner single quotes | ||
declare s space q=\' | ||
declare s space='' q=\' | ||
for s; do | ||
printf "$space'%s'" "${s//$q/$q\\$q$q}" | ||
space=' ' | ||
|