Skip to content

Commit 1af724a

Browse files
committed
Add usage
1 parent 1148132 commit 1af724a

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

git-fmt-diff

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,19 @@ EOL
455455

456456
usage () (
457457
cat << EOU
458+
usage: git fmt-diff [<options>] [<commit>] [--] [<path>...]
459+
or: git fmt-diff [<options>] --cached [<commit>] [--] [<path>...]
460+
or: git fmt-diff [<options>] <commit>...<commit> [--] [<path>...]
461+
or: git fmt-diff [<options>] <blob> <blob>
462+
463+
options:
464+
-h display this help and exit
465+
--cached view the changes you staged for the next commit relative
466+
to the named <commit> (which defaults to HEAD)
467+
--staged a synonym of --cached
468+
--color always show colors
469+
--no-color turn off colored diff
470+
--config <file> read config from specified file rather than \$GIT_DIR/.git-$gc_prog_name
458471
EOU
459472
)
460473

@@ -466,10 +479,6 @@ main () (
466479
usage
467480
exit
468481
;;
469-
--help)
470-
man "$0"
471-
exit
472-
;;
473482
--cached|--staged)
474483
g_cached_opt="--cached"
475484
;;
@@ -479,7 +488,7 @@ main () (
479488
--debug=*)
480489
gf_debug="${1#--debug=}"
481490
;;
482-
-c|--config)
491+
--config)
483492
g_config="$2"
484493
if [ -z "$g_config" ]; then
485494
warn "option 'config' requires a path to config file as argument"
@@ -494,6 +503,7 @@ main () (
494503
gf_use_color=0
495504
;;
496505
--)
506+
shift
497507
break
498508
;;
499509
-?*)

0 commit comments

Comments
 (0)