change exit codes
This commit is contained in:
parent
0eb7823f56
commit
aff332d58c
@ -68,7 +68,7 @@ environment variable `XDG_DATA_DIRS`.
|
|||||||
## RETURN VALUES
|
## RETURN VALUES
|
||||||
|
|
||||||
The command returns 0 if .desktop files were found that match the specified
|
The command returns 0 if .desktop files were found that match the specified
|
||||||
criteria, 1 on usage error and 2 if no matching .desktop files were found.
|
criteria, 1 if no matching .desktop files were found and 127 on usage error.
|
||||||
|
|
||||||
## EXAMPLE
|
## EXAMPLE
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ parse_options() {
|
|||||||
-d|--show-directive)
|
-d|--show-directive)
|
||||||
[[ $counter -gt $argc ]] && {
|
[[ $counter -gt $argc ]] && {
|
||||||
echo "ERROR: Missing argument for option -d; aborted." >&2 ;
|
echo "ERROR: Missing argument for option -d; aborted." >&2 ;
|
||||||
exit 1 ;
|
exit 127 ;
|
||||||
}
|
}
|
||||||
show_directives+=( "$1" )
|
show_directives+=( "$1" )
|
||||||
shift
|
shift
|
||||||
@ -148,7 +148,7 @@ parse_options() {
|
|||||||
-s|--search-directive)
|
-s|--search-directive)
|
||||||
[[ $counter -gt $argc ]] && {
|
[[ $counter -gt $argc ]] && {
|
||||||
echo "ERROR: Missing argument for option -s; aborted." >&2 ;
|
echo "ERROR: Missing argument for option -s; aborted." >&2 ;
|
||||||
exit 1 ;
|
exit 127 ;
|
||||||
}
|
}
|
||||||
search_directives+=( "$1" )
|
search_directives+=( "$1" )
|
||||||
shift
|
shift
|
||||||
@ -209,7 +209,7 @@ done
|
|||||||
if [[ $found -gt 0 ]] ; then
|
if [[ $found -gt 0 ]] ; then
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
exit 2
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab:
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab:
|
||||||
|
Loading…
Reference in New Issue
Block a user