From 4d1f11903393bd79998144ce1089ce427a49a2ed Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 29 Jul 2005 11:01:26 +0200 Subject: [PATCH] Unify usage strings declaration All usage strings are now declared as static const char []. This is carried over from my old git-pb branch. Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- checkout-cache.c | 2 +- commit-tree.c | 2 +- diff-cache.c | 2 +- diff-files.c | 2 +- diff-helper.c | 2 +- diff-stages.c | 2 +- diff-tree.c | 2 +- hash-object.c | 2 +- local-pull.c | 2 +- ls-files.c | 3 +-- ls-tree.c | 2 +- read-tree.c | 2 +- ssh-push.c | 2 +- tar-tree.c | 2 +- test-delta.c | 2 +- var.c | 2 +- verify-pack.c | 2 +- 17 files changed, 17 insertions(+), 18 deletions(-) diff --git a/checkout-cache.c b/checkout-cache.c index d6c4ff1042..8d67403ae8 100644 --- a/checkout-cache.c +++ b/checkout-cache.c @@ -75,7 +75,7 @@ static int checkout_all(void) return 0; } -static const char *checkout_cache_usage = +static const char checkout_cache_usage[] = "git-checkout-cache [-u] [-q] [-a] [-f] [-n] [--prefix=] [--] ..."; int main(int argc, char **argv) diff --git a/commit-tree.c b/commit-tree.c index d545f62aaa..b1ef0b590a 100644 --- a/commit-tree.c +++ b/commit-tree.c @@ -64,7 +64,7 @@ static void check_valid(unsigned char *sha1, const char *expect) #define MAXPARENT (16) static unsigned char parent_sha1[MAXPARENT][20]; -static char *commit_tree_usage = "git-commit-tree [-p ]* < changelog"; +static const char commit_tree_usage[] = "git-commit-tree [-p ]* < changelog"; static int new_parent(int idx) { diff --git a/diff-cache.c b/diff-cache.c index e3c4c8155c..47a4e09ecc 100644 --- a/diff-cache.c +++ b/diff-cache.c @@ -163,7 +163,7 @@ static void mark_merge_entries(void) } } -static char *diff_cache_usage = +static const char diff_cache_usage[] = "git-diff-cache [-m] [--cached] " "[] [...]" COMMON_DIFF_OPTIONS_HELP; diff --git a/diff-files.c b/diff-files.c index 39dd54f80a..2e6416e386 100644 --- a/diff-files.c +++ b/diff-files.c @@ -6,7 +6,7 @@ #include "cache.h" #include "diff.h" -static const char *diff_files_usage = +static const char diff_files_usage[] = "git-diff-files [-q] " "[] [...]" COMMON_DIFF_OPTIONS_HELP; diff --git a/diff-helper.c b/diff-helper.c index 07ccd7cc38..3fa50ee75b 100644 --- a/diff-helper.c +++ b/diff-helper.c @@ -20,7 +20,7 @@ static void flush_them(int ac, const char **av) diff_flush(DIFF_FORMAT_PATCH, '\n'); } -static const char *diff_helper_usage = +static const char diff_helper_usage[] = "git-diff-helper [-z] [-O] [-S] [--pickaxe-all] [...]"; int main(int ac, const char **av) { diff --git a/diff-stages.c b/diff-stages.c index cbaba552b3..2e9c0bce6e 100644 --- a/diff-stages.c +++ b/diff-stages.c @@ -17,7 +17,7 @@ static int diff_break_opt = -1; static const char *orderfile = NULL; static const char *diff_filter = NULL; -static char *diff_stages_usage = +static const char diff_stages_usage[] = "git-diff-stages [] [...]" COMMON_DIFF_OPTIONS_HELP; diff --git a/diff-tree.c b/diff-tree.c index 5b9467d58b..0dd3cdacb2 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -395,7 +395,7 @@ static int diff_tree_stdin(char *line) return diff_tree_commit(commit, line); } -static char *diff_tree_usage = +static const char diff_tree_usage[] = "git-diff-tree [--stdin] [-m] [-s] [-v] [--pretty] [-t] " "[] " COMMON_DIFF_OPTIONS_HELP; diff --git a/hash-object.c b/hash-object.c index 0821e543f5..c8c9adb3aa 100644 --- a/hash-object.c +++ b/hash-object.c @@ -21,7 +21,7 @@ static void hash_object(const char *path, const char *type, int write_object) printf("%s\n", sha1_to_hex(sha1)); } -static const char *hash_object_usage = +static const char hash_object_usage[] = "git-hash-object [-t ] [-w] ..."; int main(int argc, char **argv) diff --git a/local-pull.c b/local-pull.c index 908e187509..29ae166395 100644 --- a/local-pull.c +++ b/local-pull.c @@ -101,7 +101,7 @@ int fetch_ref(char *ref, unsigned char *sha1) return 0; } -static const char *local_pull_usage = +static const char local_pull_usage[] = "git-local-pull [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] [-l] [-s] [-n] commit-id path"; /* diff --git a/ls-files.c b/ls-files.c index 41a1f9d1c2..13ca02ec73 100644 --- a/ls-files.c +++ b/ls-files.c @@ -400,11 +400,10 @@ static void show_files(void) } } -static const char *ls_files_usage = +static const char ls_files_usage[] = "git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed])* " "[ --ignored ] [--exclude=] [--exclude-from=] " "[ --exclude-per-directory= ]"; -; int main(int argc, char **argv) { diff --git a/ls-tree.c b/ls-tree.c index 8d524b89a2..e198a20cb3 100644 --- a/ls-tree.c +++ b/ls-tree.c @@ -208,7 +208,7 @@ static int list(char **path) return err; } -static const char *ls_tree_usage = +static const char ls_tree_usage[] = "git-ls-tree [-d] [-r] [-z] [path...]"; int main(int argc, char **argv) diff --git a/read-tree.c b/read-tree.c index 65f2d9a5dc..ce2bb88f0a 100644 --- a/read-tree.c +++ b/read-tree.c @@ -510,7 +510,7 @@ static int read_cache_unmerged(void) return deleted; } -static char *read_tree_usage = "git-read-tree ( | -m [-u] [ []])"; +static const char read_tree_usage[] = "git-read-tree ( | -m [-u] [ []])"; static struct cache_file cache_file; diff --git a/ssh-push.c b/ssh-push.c index aac70af514..ee424a8712 100644 --- a/ssh-push.c +++ b/ssh-push.c @@ -96,7 +96,7 @@ static void service(int fd_in, int fd_out) { } while (1); } -static const char *ssh_push_usage = +static const char ssh_push_usage[] = "git-ssh-push [-c] [-t] [-a] [-w ref] commit-id url"; int main(int argc, char **argv) diff --git a/tar-tree.c b/tar-tree.c index 673ac66ed6..a877fe545e 100644 --- a/tar-tree.c +++ b/tar-tree.c @@ -17,7 +17,7 @@ #define EXT_HEADER_PATH 1 #define EXT_HEADER_LINKPATH 2 -static const char *tar_tree_usage = "git-tar-tree [basedir]"; +static const char tar_tree_usage[] = "git-tar-tree [basedir]"; static char block[BLOCKSIZE]; static unsigned long offset; diff --git a/test-delta.c b/test-delta.c index e5d31ca2e7..1be8ee0c72 100644 --- a/test-delta.c +++ b/test-delta.c @@ -17,7 +17,7 @@ #include #include "delta.h" -static const char *usage = +static const char usage[] = "test-delta (-d|-p) "; int main(int argc, char *argv[]) diff --git a/var.c b/var.c index 488ec5147a..3f13126cb8 100644 --- a/var.c +++ b/var.c @@ -8,7 +8,7 @@ #include #include -static char *var_usage = "git-var [-l | ]"; +static const char var_usage[] = "git-var [-l | ]"; struct git_var { const char *name; diff --git a/verify-pack.c b/verify-pack.c index 30c40feebd..80b60a6b7c 100644 --- a/verify-pack.c +++ b/verify-pack.c @@ -27,7 +27,7 @@ static int verify_one_pack(char *arg, int verbose) return verify_pack(g, verbose); } -static const char *verify_pack_usage = "git-verify-pack [-v] ..."; +static const char verify_pack_usage[] = "git-verify-pack [-v] ..."; int main(int ac, char **av) { -- cgit v1.2.3