Open MASHtm opened 3 years ago
Since getopts doesn't support long opts I used:
--- clamav-unofficial-sigs.sh (revision 5032)
+++ clamav-unofficial-sigs.sh (working copy)
@@ -1710,14 +1710,15 @@
fi
# Generic command line options
-while true ; do
+while :; do
case "${1}" in
- -c|--config) xshok_check_s2 "${2}"; custom_config="${2}"; shift 2; break ;;
- -F|--force) force_updates="yes"; shift 1; break ;;
- -v|--verbose) force_verbose="yes"; shift 1; break ;;
- -s|--silence) force_verbose="no"; shift 1; break ;;
+ -c|--config) xshok_check_s2 "${2}"; custom_config="${2}"; shift ;;
+ -F|--force) force_updates="yes" ;;
+ -v|--verbose) force_verbose="yes" ;;
+ -s|--silence) force_verbose="no" ;;
*) break ;;
esac
+ shift
done
# Set the verbosity
Would this fix work on all versions that the script supports? If so then feel free to create a pull request with these changes. Even if not final this creates discussion hopefully to fix this.
If multiple command line options are used only the first one gets parsed. eg. "-c configpath --force". This is caused by misplaced "break" commands
I think it would be better to use the bash builtin getopts like