Merge pull request #969 from xexyl/sgit-error-messages
This commit is contained in:
3 files changed
+13
-6
No files matched your search
+6
-2
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env make
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# sgit - run sed (by default with -i) on all files (or one or more globs) under
|
# sgit - run sed (by default with -i) on one or more globs under git control
|
||||||
# git control.
|
|
||||||
#
|
#
|
||||||
# The most up to date version of this tool and everything related can be found
|
# The most up to date version of this tool and everything related can be found
|
||||||
# at https://github.com/xexyl/sgit.
|
# at https://github.com/xexyl/sgit.
|
||||||
@@ -22,6 +21,7 @@ CP= cp
|
|||||||
INSTALL= install
|
INSTALL= install
|
||||||
RM= rm
|
RM= rm
|
||||||
SHELL= bash
|
SHELL= bash
|
||||||
|
SHELLCHECK= shellcheck
|
||||||
|
|
||||||
#CFLAGS= -O3 -g3 --pedantic -Wall -Werror
|
#CFLAGS= -O3 -g3 --pedantic -Wall -Werror
|
||||||
CFLAGS= -O3 -g3 --pedantic -Wall
|
CFLAGS= -O3 -g3 --pedantic -Wall
|
||||||
@@ -46,6 +46,10 @@ winner_name: winner_name.sh
|
|||||||
${CP} -f -v $? $@
|
${CP} -f -v $? $@
|
||||||
${CHMOD} +x $@
|
${CHMOD} +x $@
|
||||||
|
|
||||||
|
|
||||||
|
shellcheck: sgit.sh
|
||||||
|
@${SHELLCHECK} sgit.sh
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# .PHONY list of rules that do not create files #
|
# .PHONY list of rules that do not create files #
|
||||||
#################################################
|
#################################################
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ usage: sgit [-h] [-V] [-v level] [-x] [-I] [-i extension] [-o sed_option(s)] [-s
|
|||||||
-s sed set path to sed
|
-s sed set path to sed
|
||||||
-e command append sed command to list of commands to execute on globs
|
-e command append sed command to list of commands to execute on globs
|
||||||
|
|
||||||
sgit version: 0.0.9-1 24-04-2023
|
sgit version: 0.0.10-1 24-04-2023
|
||||||
```
|
```
|
||||||
|
|
||||||
You **MUST** specify at least one `sed` command and one glob: the sed command by
|
You **MUST** specify at least one `sed` command and one glob: the sed command by
|
||||||
|
|||||||
+6
-3
@@ -21,7 +21,7 @@
|
|||||||
# - Cody Boone Ferguson (@xexyl)
|
# - Cody Boone Ferguson (@xexyl)
|
||||||
#
|
#
|
||||||
|
|
||||||
export SGIT_VERSION="0.0.9-1 24-04-2023" # format: major.minor.patch-release DD-MM-YYYY
|
export SGIT_VERSION="0.0.10-1 24-04-2023" # format: major.minor.patch-release DD-MM-YYYY
|
||||||
|
|
||||||
USAGE="usage: $(basename "$0") [-h] [-V] [-v level] [-x] [-I] [-i extension] [-o sed_option(s)] [-s sed] [-e command] <glob...>
|
USAGE="usage: $(basename "$0") [-h] [-V] [-v level] [-x] [-I] [-i extension] [-o sed_option(s)] [-s sed] [-e command] <glob...>
|
||||||
|
|
||||||
@@ -93,7 +93,10 @@ while getopts :hVv:xIi:o:s:e: flag; do
|
|||||||
echo "$USAGE" 1>&2
|
echo "$USAGE" 1>&2
|
||||||
exit 3
|
exit 3
|
||||||
;;
|
;;
|
||||||
*)
|
*) echo "$0: ERROR: unexpected value from getopts: $flag" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
echo "$USAGE" 1>&2
|
||||||
|
exit 3
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -104,7 +107,7 @@ shift $(( OPTIND - 1 ));
|
|||||||
|
|
||||||
# check that SED_COMMANDS is not empty!
|
# check that SED_COMMANDS is not empty!
|
||||||
if [[ -z "${SED_COMMANDS[*]}" ]]; then
|
if [[ -z "${SED_COMMANDS[*]}" ]]; then
|
||||||
echo "$(basename "$0"): ERROR: you must specify at least one sed command" 1>&2
|
echo "$(basename "$0"): ERROR: you must specify at least one sed command and one glob" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$USAGE" 1>&2
|
echo "$USAGE" 1>&2
|
||||||
exit 2
|
exit 2
|
||||||
|
|||||||
Reference in new issue
Block a user