Verified Commit 455e2b94 authored by nl6720's avatar nl6720
Browse files

Check command line parameter count instead of option count, and do it after...

Check command line parameter count instead of option count, and do it after evaluating option arguments

Fixes b6241cb1 .
parent b6241cb1
...@@ -827,7 +827,9 @@ while getopts 'p:r:C:L:P:A:D:w:o:s:c:g:vh?' arg; do ...@@ -827,7 +827,9 @@ while getopts 'p:r:C:L:P:A:D:w:o:s:c:g:vh?' arg; do
esac esac
done done
if (( OPTIND <= 1 )); then shift $((OPTIND - 1))
if (( $# < 1 )); then
_msg_error "No command specified" 0 _msg_error "No command specified" 0
_usage 1 _usage 1
fi fi
...@@ -836,7 +838,6 @@ if (( EUID != 0 )); then ...@@ -836,7 +838,6 @@ if (( EUID != 0 )); then
_msg_error "${app_name} must be run as root." 1 _msg_error "${app_name} must be run as root." 1
fi fi
shift $((OPTIND - 1))
command_name="${1}" command_name="${1}"
# Set directory path defaults for legacy commands # Set directory path defaults for legacy commands
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment