On Fri, Aug 31, 2018 at 4:01 PM Jeff King [off-list ref] wrote:
On Fri, Aug 31, 2018 at 02:33:17AM -0400, Eric Sunshine wrote:
quoted
OPTIONS_SPEC="\
doc-diff [options] <from> <to> [-- <diff-options>]
+doc-diff (-c|--clean)
--
j=n parallel argument to pass to make
f force rebuild; do not rely on cached results
+c,clean cleanup temporary working files
"
This will cause parseopt to normalize "--clean" to "-c" (along with
"--cle", etc).
Good to know. The documentation for git-sh-setup didn't talk about
that at all, and while git-rev-parse documentation says that it
"normalizes" options, that word didn't really convey this specific
meaning to me, so I missed it.
quoted
while test $# -gt 0
do
case "$1" in
-j)
parallel=$2; shift ;;
+ -c|--clean)
+ clean=t ;;
So this part can just test for "-c". AFAICT this is how "rev-parse
--parseopt" has always worked, though the documentation is quite
unclear. Other scripts seem to also use these redundant long options.
I'm not opposed to including it as a defensive measure (or simply an
annotation for the reader).
I'm fine leaving it as-is too since it seems that every other client
of git-sh-setup does the same (and to save a re-roll).