[Lemon-commits] Peter Kovacs: Small improvements in the unifier ...
Lemon HG
hg at lemon.cs.elte.hu
Wed Oct 22 15:41:48 CEST 2008
details: http://lemon.cs.elte.hu/hg/lemon/rev/cdbff91c2166
changeset: 340:cdbff91c2166
user: Peter Kovacs <kpeter [at] inf.elte.hu>
date: Mon Oct 20 12:17:24 2008 +0200
description:
Small improvements in the unifier script
diffstat:
1 file changed, 15 insertions(+), 15 deletions(-)
scripts/unify-sources.sh | 30 +++++++++++++++---------------
diffs (84 lines):
diff -r e05633b02e40 -r cdbff91c2166 scripts/unify-sources.sh
--- a/scripts/unify-sources.sh Sun Oct 19 16:19:32 2008 +0200
+++ b/scripts/unify-sources.sh Mon Oct 20 12:17:24 2008 +0200
@@ -212,7 +212,7 @@
TMP_FILE=`mktemp`
cat $1 | sed -e 's/ \+$//g' >$TMP_FILE
- "$ACTION"_action "$TMP_FILE" "$1" 'spaces'
+ "$ACTION"_action "$TMP_FILE" "$1" 'trailing spaces'
}
function long_lines_check() {
@@ -225,7 +225,7 @@
# process the file
function process_file() {
- echo -n " $ACTION " $1...
+ echo -n " $ACTION $1..."
CHECKING="header tabs spaces long_lines"
@@ -259,12 +259,12 @@
--dry-run|-n
Check the given files, but do not modify them.
--interactive|-i
- If --dry-run is specified and files are warned then a message is
+ If --dry-run is specified and files are warned, then a message is
prompted whether the warnings should be turned to errors.
--werror|-w
- If --dry-run is specified and the warnings are turned to errors.
+ If --dry-run is specified, the warnings are turned to errors.
--all|-a
- All files in the repository will be checked.
+ Check all source files in the repository.
--modified|-m
Check only the modified source files. This option is proper to
use before a commit. E.g. all files which are modified or added
@@ -282,36 +282,36 @@
--help|-h
Print this help message.
files
- The files to check/unify. If no file names are given, the
- modified source will be checked/unified
-
+ The files to check/unify. If no file names are given, the modified
+ source files will be checked/unified (just like using the
+ --modified|-m option).
"
exit 0
elif [ "$1" == '--dry-run' ] || [ "$1" == '-n' ]
then
- [ -n "$ACTION" ] && echo "Invalid option $1" >&2 && exit 1
+ [ -n "$ACTION" ] && echo "Conflicting action options" >&2 && exit 1
ACTION=check
elif [ "$1" == "--all" ] || [ "$1" == '-a' ]
then
- [ -n "$FILES" ] && echo "Invalid option $1" >&2 && exit 1
+ [ -n "$FILES" ] && echo "Conflicting target options" >&2 && exit 1
FILES=all_files
elif [ "$1" == "--changed" ] || [ "$1" == '-c' ]
then
- [ -n "$FILES" ] && echo "Invalid option $1" >&2 && exit 1
+ [ -n "$FILES" ] && echo "Conflicting target options" >&2 && exit 1
FILES=changed_files
elif [ "$1" == "--modified" ] || [ "$1" == '-m' ]
then
- [ -n "$FILES" ] && echo "Invalid option $1" >&2 && exit 1
+ [ -n "$FILES" ] && echo "Conflicting target options" >&2 && exit 1
FILES=modified_files
elif [ "$1" == "--interactive" ] || [ "$1" == "-i" ]
then
- [ -n "$WARNING" ] && echo "Invalid option $1" >&2 && exit 1
+ [ -n "$WARNING" ] && echo "Conflicting warning options" >&2 && exit 1
WARNING='INTERACTIVE'
elif [ "$1" == "--werror" ] || [ "$1" == "-w" ]
then
- [ -n "$WARNING" ] && echo "Invalid option $1" >&2 && exit 1
+ [ -n "$WARNING" ] && echo "Conflicting warning options" >&2 && exit 1
WARNING='WERROR'
- elif [ $(echo $1 | cut -c 1) == '-' ]
+ elif [ $(echo x$1 | cut -c 2) == '-' ]
then
echo "Invalid option $1" >&2 && exit 1
else
More information about the Lemon-commits
mailing list