File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ options:
4545 --fmtprg-stderr show stderr from formatter programs
4646 --warn-risky-stderr redirects warning about potential unsolicited changes in suggestions to stderr;
4747 option not recommended as the warning blocks dangerous 'git apply'
48+ --version print version of git-fmt-diff script
4849```
4950
5051## Installation
Original file line number Diff line number Diff line change 66# globals {{{
77
88gc_prog_name=" fmt-diff"
9+ gc_version=" 0.1.5-3-geb406e4"
910
1011g_cached_opt=
1112
@@ -456,14 +457,14 @@ EOL
456457 wait
457458
458459 if [ -s " $risky " ]; then
459- cat > " $risky " .temp << EOW
460+ cat > " $risky " .temp << EOF
460461$( sgr 33 ' @ WARNING!' )
461462$( sgr 33 ' @ Suggestions for the following files might smuggle unsolicited changes:' )
462463$( sort " $risky " | sed ' s/^/- /' )
463464$( sgr 33 " @ Review them thoroughly before applying." )
464465
465466
466- EOW
467+ EOF
467468 mv " $risky " .temp " $risky "
468469
469470 if [ " $gf_warn_risky_stderr " -eq 1 ]; then
480481# }}}1
481482
482483usage () {
483- cat << EOU
484+ cat << EOF
484485usage: git fmt-diff [<options>] [<commit>] [--] [<path>...]
485486 or: git fmt-diff [<options>] --cached [<commit>] [--] [<path>...]
486487 or: git fmt-diff [<options>] <commit>...<commit> [--] [<path>...]
@@ -496,7 +497,8 @@ options:
496497 --fmtprg-stderr show stderr from formatter programs
497498 --warn-risky-stderr redirects warning about potential unsolicited changes in suggestions to stderr;
498499 option not recommended as the warning blocks dangerous 'git apply'
499- EOU
500+ --version print version of git-$gc_prog_name script
501+ EOF
500502}
501503
502504# parse options {{{2
@@ -536,6 +538,10 @@ while :; do
536538 --warn-risky-stderr)
537539 gf_warn_risky_stderr=1
538540 ;;
541+ --version)
542+ echo " $gc_version "
543+ exit
544+ ;;
539545 --)
540546 shift
541547 break
You can’t perform that action at this time.
0 commit comments