gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Better help message and user question in unify-sources.sh
0 1 0
default
1 file changed with 14 insertions and 15 deletions:
↑ Collapse diff ↑
Ignore white space 12 line context
... ...
@@ -62,13 +62,13 @@
62 62
    CHANGED_FILES=0
63 63
    WARNED_FILES=0
64 64
}
65 65

	
66 66
function update_done() {
67 67
    echo $CHANGED_FILES out of $TOTAL_FILES files has been changed.
68
    echo $WARNED_FILES out of $TOTAL_FILES files has been warned.
68
    echo $WARNED_FILES out of $TOTAL_FILES files triggered warnings.
69 69
}
70 70

	
71 71
function update_begin() {
72 72
    ((TOTAL_FILES++))
73 73
    CHANGED=NO
74 74
    WARNED=NO
... ...
@@ -104,32 +104,32 @@
104 104
    WARNED_FILES=0
105 105
    TOTAL_FILES=0
106 106
}
107 107

	
108 108
function check_done() {
109 109
    echo $FAILED_FILES out of $TOTAL_FILES files has been failed.
110
    echo $WARNED_FILES out of $TOTAL_FILES files has been warned.
110
    echo $WARNED_FILES out of $TOTAL_FILES files triggered warnings.
111 111

	
112 112
    if [ $FAILED_FILES -gt 0 ]
113 113
    then
114 114
	return 1
115 115
    elif [ $WARNED_FILES -gt 0 ]
116 116
    then
117 117
	if [ "$WARNING" == 'INTERACTIVE' ]
118 118
	then
119
	    echo -n "Assume as normal behaviour? (yes/no) "
119
	    echo -n "Are the files with warnings acceptable? (yes/no) "
120 120
	    while read answer
121 121
	    do
122 122
		if [ "$answer" == 'yes' ]
123 123
		then
124 124
		    return 0
125 125
		elif [ "$answer" == 'no' ]
126 126
		then
127 127
		    return 1
128 128
		fi
129
		echo -n "Assume as normal behaviour? (yes/no) "		    
129
		echo -n "Are the files with warnings acceptable? (yes/no) "
130 130
	    done
131 131
	elif [ "$WARNING" == 'WERROR' ]
132 132
	then
133 133
	    return 1
134 134
	fi
135 135
    fi
... ...
@@ -254,30 +254,29 @@
254 254
    then
255 255
	echo -n \
256 256
"Usage:
257 257
  $0 [OPTIONS] [files]
258 258
Options:
259 259
  --dry-run|-n
260
     Check the given files, but do not modify them.
260
     Check the files, but do not modify them.
261 261
  --interactive|-i
262
     If --dry-run is specified and files are warned then a message is
263
     prompted whether the warnings should be turned to errors.
262
     If --dry-run is specified and the checker emits warnings,
263
     then the user is asked if the warnings should be considered
264
     errors.
264 265
  --werror|-w
265
     If --dry-run is specified and the warnings are turned to errors.
266
     Make all warnings into errors.
266 267
  --all|-a
267 268
     All files in the repository will be checked.
268 269
  --modified|-m
269
     Check only the modified source files. This option is proper to
270
     use before a commit. E.g. all files which are modified or added
271
     into the repository will be updated.
270
     Check only the modified (and new) source files. This option is
271
     useful to check the modification before making a commit.
272 272
  --changed|-c
273 273
     Check only the changed source files compared to the parent(s) of
274
     the current hg node.  This option is proper to use as hg hook
275
     script. E.g. to check all your commited source files with this
276
     script add the following section to the appropriate .hg/hgrc
277
     file.
274
     the current hg node.  This option is useful as hg hook script.
275
     To automatically check all your changes before making a commit,
276
     add the following section to the appropriate .hg/hgrc file.
278 277

	
279 278
       [hooks]
280 279
       pretxncommit.checksources = scripts/unify-sources.sh -c -n -i
281 280

	
282 281
  --help|-h
283 282
     Print this help message.
0 comments (0 inline)