From 1b1dd23f2d6a707b7077cdf6bc6d4055bd0bfb7d Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sun, 13 Jul 2008 15:36:15 +0200 Subject: [PATCH] Make usage strings dash-less When you misuse a git command, you are shown the usage string. But this is currently shown in the dashed form. So if you just copy what you see, it will not work, when the dashed form is no longer supported. This patch makes git commands show the dash-less version. For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh generates a dash-less usage string now. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- builtin-add.c | 2 +- builtin-apply.c | 2 +- builtin-archive.c | 2 +- builtin-blame.c | 2 +- builtin-branch.c | 8 ++++---- builtin-cat-file.c | 4 ++-- builtin-check-attr.c | 2 +- builtin-checkout-index.c | 2 +- builtin-clean.c | 2 +- builtin-clone.c | 2 +- builtin-commit.c | 4 ++-- builtin-config.c | 2 +- builtin-count-objects.c | 2 +- builtin-describe.c | 2 +- builtin-diff-files.c | 2 +- builtin-diff-index.c | 2 +- builtin-diff-tree.c | 2 +- builtin-diff.c | 2 +- builtin-fast-export.c | 2 +- builtin-fetch-pack.c | 2 +- builtin-fetch.c | 2 +- builtin-fmt-merge-msg.c | 2 +- builtin-for-each-ref.c | 2 +- builtin-fsck.c | 2 +- builtin-gc.c | 2 +- builtin-grep.c | 2 +- builtin-init-db.c | 2 +- builtin-log.c | 2 +- builtin-ls-files.c | 2 +- builtin-ls-remote.c | 2 +- builtin-ls-tree.c | 2 +- builtin-mailinfo.c | 2 +- builtin-mailsplit.c | 2 +- builtin-merge-base.c | 2 +- builtin-mv.c | 2 +- builtin-name-rev.c | 2 +- builtin-pack-refs.c | 2 +- builtin-prune-packed.c | 2 +- builtin-prune.c | 2 +- builtin-push.c | 2 +- builtin-reflog.c | 6 +++--- builtin-rerere.c | 2 +- builtin-reset.c | 4 ++-- builtin-rev-list.c | 2 +- builtin-rev-parse.c | 2 +- builtin-revert.c | 4 ++-- builtin-rm.c | 2 +- builtin-send-pack.c | 2 +- builtin-shortlog.c | 2 +- builtin-show-branch.c | 2 +- builtin-symbolic-ref.c | 2 +- builtin-tag.c | 8 ++++---- builtin-tar-tree.c | 2 +- builtin-update-index.c | 2 +- builtin-update-ref.c | 4 ++-- builtin-upload-archive.c | 6 +++--- builtin-verify-tag.c | 2 +- builtin-write-tree.c | 2 +- daemon.c | 2 +- fast-import.c | 2 +- git-am.sh | 6 +++--- git-archimport.perl | 4 ++-- git-cvsexportcommit.perl | 2 +- git-cvsimport.perl | 2 +- git-cvsserver.perl | 2 +- git-instaweb.sh | 2 +- git-merge.sh | 4 ++-- git-pull.sh | 2 +- git-quiltimport.sh | 2 +- git-relink.perl | 2 +- git-repack.sh | 2 +- git-send-email.perl | 2 +- git-sh-setup.sh | 7 ++++--- git-svn.perl | 2 +- hash-object.c | 2 +- help.c | 2 +- http-push.c | 2 +- index-pack.c | 2 +- pack-redundant.c | 2 +- update-server-info.c | 2 +- 80 files changed, 102 insertions(+), 101 deletions(-) diff --git a/builtin-add.c b/builtin-add.c index 9930cf53f..bf13aa3ad 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -16,7 +16,7 @@ #include "parse-options.h" static const char * const builtin_add_usage[] = { - "git-add [options] [--] ...", + "git add [options] [--] ...", NULL }; static int patch_interactive = 0, add_interactive = 0; diff --git a/builtin-apply.c b/builtin-apply.c index d13313f10..e15471b5b 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -46,7 +46,7 @@ static const char *fake_ancestor; static int line_termination = '\n'; static unsigned long p_context = ULONG_MAX; static const char apply_usage[] = -"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--cached] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [--reverse] [--reject] [--verbose] [-z] [-pNUM] [-CNUM] [--whitespace=] ..."; +"git apply [--stat] [--numstat] [--summary] [--check] [--index] [--cached] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [--reverse] [--reject] [--verbose] [-z] [-pNUM] [-CNUM] [--whitespace=] ..."; static enum ws_error_action { nowarn_ws_error, diff --git a/builtin-archive.c b/builtin-archive.c index c2e0c1ea5..5cca46012 100644 --- a/builtin-archive.c +++ b/builtin-archive.c @@ -13,7 +13,7 @@ #include "attr.h" static const char archive_usage[] = \ -"git-archive --format= [--prefix=/] [--verbose] [] [path...]"; +"git archive --format= [--prefix=/] [--verbose] [] [path...]"; static struct archiver_desc { diff --git a/builtin-blame.c b/builtin-blame.c index b451f6c64..91850a53e 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -20,7 +20,7 @@ #include "mailmap.h" static char blame_usage[] = -"git-blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [-L n,m] [-S ] [-M] [-C] [-C] [--contents ] [--incremental] [commit] [--] file\n" +"git blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [-L n,m] [-S ] [-M] [-C] [-C] [--contents ] [--incremental] [commit] [--] file\n" " -c Use the same output mode as git-annotate (Default: off)\n" " -b Show blank SHA-1 for boundary commits (Default: off)\n" " -l Show long commit SHA1 (Default: off)\n" diff --git a/builtin-branch.c b/builtin-branch.c index d279702ba..5cc3771dd 100644 --- a/builtin-branch.c +++ b/builtin-branch.c @@ -15,10 +15,10 @@ #include "branch.h" static const char * const builtin_branch_usage[] = { - "git-branch [options] [-r | -a] [--merged | --no-merged]", - "git-branch [options] [-l] [-f] []", - "git-branch [options] [-r] (-d | -D) ", - "git-branch [options] (-m | -M) [] ", + "git branch [options] [-r | -a] [--merged | --no-merged]", + "git branch [options] [-l] [-f] []", + "git branch [options] [-r] (-d | -D) ", + "git branch [options] (-m | -M) [] ", NULL }; diff --git a/builtin-cat-file.c b/builtin-cat-file.c index 880e75af5..7441a56ac 100644 --- a/builtin-cat-file.c +++ b/builtin-cat-file.c @@ -202,8 +202,8 @@ static int batch_objects(int print_contents) } static const char * const cat_file_usage[] = { - "git-cat-file [-t|-s|-e|-p|] ", - "git-cat-file [--batch|--batch-check] < ", + "git cat-file [-t|-s|-e|-p|] ", + "git cat-file [--batch|--batch-check] < ", NULL }; diff --git a/builtin-check-attr.c b/builtin-check-attr.c index 6afdfa10a..cb783fc77 100644 --- a/builtin-check-attr.c +++ b/builtin-check-attr.c @@ -4,7 +4,7 @@ #include "quote.h" static const char check_attr_usage[] = -"git-check-attr attr... [--] pathname..."; +"git check-attr attr... [--] pathname..."; int cmd_check_attr(int argc, const char **argv, const char *prefix) { diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c index eb1fc9aa6..71ebabf99 100644 --- a/builtin-checkout-index.c +++ b/builtin-checkout-index.c @@ -154,7 +154,7 @@ static void checkout_all(const char *prefix, int prefix_length) } static const char checkout_cache_usage[] = -"git-checkout-index [-u] [-q] [-a] [-f] [-n] [--stage=[123]|all] [--prefix=] [--temp] [--] ..."; +"git checkout-index [-u] [-q] [-a] [-f] [-n] [--stage=[123]|all] [--prefix=] [--temp] [--] ..."; static struct lock_file lock_file; diff --git a/builtin-clean.c b/builtin-clean.c index 80a7ff9ae..48bf29f40 100644 --- a/builtin-clean.c +++ b/builtin-clean.c @@ -15,7 +15,7 @@ static int force = -1; /* unset */ static const char *const builtin_clean_usage[] = { - "git-clean [-d] [-f] [-n] [-q] [-x | -X] [--] ...", + "git clean [-d] [-f] [-n] [-q] [-x | -X] [--] ...", NULL }; diff --git a/builtin-clone.c b/builtin-clone.c index ec3620960..8112716c1 100644 --- a/builtin-clone.c +++ b/builtin-clone.c @@ -29,7 +29,7 @@ * */ static const char * const builtin_clone_usage[] = { - "git-clone [options] [--] []", + "git clone [options] [--] []", NULL }; diff --git a/builtin-commit.c b/builtin-commit.c index 745c11e77..41cf5f2dc 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -25,12 +25,12 @@ #include "unpack-trees.h" static const char * const builtin_commit_usage[] = { - "git-commit [options] [--] ...", + "git commit [options] [--] ...", NULL }; static const char * const builtin_status_usage[] = { - "git-status [options] [--] ...", + "git status [options] [--] ...", NULL }; diff --git a/builtin-config.c b/builtin-config.c index 39f63d7b1..0cf191a11 100644 --- a/builtin-config.c +++ b/builtin-config.c @@ -3,7 +3,7 @@ #include "color.h" static const char git_config_set_usage[] = -"git-config [ --global | --system | [ -f | --file ] config-file ] [ --bool | --int | --bool-or-int ] [ -z | --null ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list | --get-color var [default] | --get-colorbool name [stdout-is-tty]"; +"git config [ --global | --system | [ -f | --file ] config-file ] [ --bool | --int | --bool-or-int ] [ -z | --null ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list | --get-color var [default] | --get-colorbool name [stdout-is-tty]"; static char *key; static regex_t *key_regexp; diff --git a/builtin-count-objects.c b/builtin-count-objects.c index f00306fb6..91b548747 100644 --- a/builtin-count-objects.c +++ b/builtin-count-objects.c @@ -67,7 +67,7 @@ static void count_objects(DIR *d, char *path, int len, int verbose, } static char const * const count_objects_usage[] = { - "git-count-objects [-v]", + "git count-objects [-v]", NULL }; diff --git a/builtin-describe.c b/builtin-describe.c index e515f9ca9..5dabca950 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -10,7 +10,7 @@ #define MAX_TAGS (FLAG_BITS - 1) static const char * const describe_usage[] = { - "git-describe [options] *", + "git describe [options] *", NULL }; diff --git a/builtin-diff-files.c b/builtin-diff-files.c index 384d87126..9bf10bb37 100644 --- a/builtin-diff-files.c +++ b/builtin-diff-files.c @@ -10,7 +10,7 @@ #include "builtin.h" static const char diff_files_usage[] = -"git-diff-files [-q] [-0/-1/2/3 |-c|--cc] [] [...]" +"git diff-files [-q] [-0/-1/2/3 |-c|--cc] [] [...]" COMMON_DIFF_OPTIONS_HELP; int cmd_diff_files(int argc, const char **argv, const char *prefix) diff --git a/builtin-diff-index.c b/builtin-diff-index.c index 2f44ebfcd..17d851b29 100644 --- a/builtin-diff-index.c +++ b/builtin-diff-index.c @@ -5,7 +5,7 @@ #include "builtin.h" static const char diff_cache_usage[] = -"git-diff-index [-m] [--cached] " +"git diff-index [-m] [--cached] " "[] [...]" COMMON_DIFF_OPTIONS_HELP; diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c index 9d2a48fd6..415cb1612 100644 --- a/builtin-diff-tree.c +++ b/builtin-diff-tree.c @@ -53,7 +53,7 @@ static int diff_tree_stdin(char *line) } static const char diff_tree_usage[] = -"git-diff-tree [--stdin] [-m] [-c] [--cc] [-s] [-v] [--pretty] [-t] [-r] [--root] " +"git diff-tree [--stdin] [-m] [-c] [--cc] [-s] [-v] [--pretty] [-t] [-r] [--root] " "[] [] [...]\n" " -r diff recursively\n" " --root include the initial commit as diff against /dev/null\n" diff --git a/builtin-diff.c b/builtin-diff.c index 4c289e798..faaa85a1d 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -21,7 +21,7 @@ struct blobinfo { }; static const char builtin_diff_usage[] = -"git-diff {0,2} -- *"; +"git diff {0,2} -- *"; static void stuff_change(struct diff_options *opt, unsigned old_mode, unsigned new_mode, diff --git a/builtin-fast-export.c b/builtin-fast-export.c index 75132bacf..76f316727 100644 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -18,7 +18,7 @@ #include "parse-options.h" static const char *fast_export_usage[] = { - "git-fast-export [rev-list-opts]", + "git fast-export [rev-list-opts]", NULL }; diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c index 1ea704063..273239af3 100644 --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@ -18,7 +18,7 @@ static struct fetch_pack_args args = { }; static const char fetch_pack_usage[] = -"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--include-tag] [--upload-pack=] [--depth=] [--no-progress] [-v] [:] [...]"; +"git fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--include-tag] [--upload-pack=] [--depth=] [--no-progress] [-v] [:] [...]"; #define COMPLETE (1U << 0) #define COMMON (1U << 1) diff --git a/builtin-fetch.c b/builtin-fetch.c index 97fdc51e3..61de50a02 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -12,7 +12,7 @@ #include "parse-options.h" static const char * const builtin_fetch_usage[] = { - "git-fetch [options] [ ...]", + "git fetch [options] [ ...]", NULL }; diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c index b892621ab..b34b01ff5 100644 --- a/builtin-fmt-merge-msg.c +++ b/builtin-fmt-merge-msg.c @@ -6,7 +6,7 @@ #include "tag.h" static const char *fmt_merge_msg_usage = - "git-fmt-merge-msg [--log] [--no-log] [--file ]"; + "git fmt-merge-msg [--log] [--no-log] [--file ]"; static int merge_summary; diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c index fef93d748..76282ad79 100644 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@ -831,7 +831,7 @@ int opt_parse_sort(const struct option *opt, const char *arg, int unset) } static char const * const for_each_ref_usage[] = { - "git-for-each-ref [options] []", + "git for-each-ref [options] []", NULL }; diff --git a/builtin-fsck.c b/builtin-fsck.c index b0f9648f8..7326dc33a 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -539,7 +539,7 @@ static int fsck_cache_tree(struct cache_tree *it) } static char const * const fsck_usage[] = { - "git-fsck [options] [...]", + "git fsck [options] [...]", NULL }; diff --git a/builtin-gc.c b/builtin-gc.c index f5625bb9f..fac200e0b 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -18,7 +18,7 @@ #define FAILED_RUN "failed to run %s" static const char * const builtin_gc_usage[] = { - "git-gc [options]", + "git gc [options]", NULL }; diff --git a/builtin-grep.c b/builtin-grep.c index ef299108f..0cac39590 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -495,7 +495,7 @@ static int grep_object(struct grep_opt *opt, const char **paths, } static const char builtin_grep_usage[] = -"git-grep