archive-zip.c: mark more strings for translation
[gitweb.git] / builtin / config.c
index 69e7270356c5a4da8372201ac80ec0d33e8909c2..a09ead5bc8f0f0b3e17463094167cc7a15f77d7e 100644 (file)
@@ -110,7 +110,7 @@ static int option_parse_type(const struct option *opt, const char *arg,
                 * --int' and '--type=bool
                 * --type=int'.
                 */
-               error("only one type at a time.");
+               error("only one type at a time");
                usage_with_options(builtin_config_usage,
                        builtin_config_options);
        }
@@ -160,7 +160,11 @@ static struct option builtin_config_options[] = {
 static void check_argc(int argc, int min, int max) {
        if (argc >= min && argc <= max)
                return;
-       error("wrong number of arguments");
+       if (min == max)
+               error("wrong number of arguments, should be %d", min);
+       else
+               error("wrong number of arguments, should be from %d to %d",
+                     min, max);
        usage_with_options(builtin_config_usage, builtin_config_options);
 }
 
@@ -398,7 +402,7 @@ static char *normalize_value(const char *key, const char *value)
                return xstrdup(value);
        }
 
-       die("BUG: cannot normalize type %d", type);
+       BUG("cannot normalize type %d", type);
 }
 
 static int get_color_found;
@@ -595,13 +599,16 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
        if (use_global_config + use_system_config + use_local_config +
            !!given_config_source.file + !!given_config_source.blob > 1) {
-               error("only one config file at a time.");
+               error("only one config file at a time");
                usage_with_options(builtin_config_usage, builtin_config_options);
        }
 
        if (use_local_config && nongit)
                die(_("--local can only be used inside a git repository"));
 
+       if (given_config_source.blob && nongit)
+               die(_("--blob can only be used inside a git repository"));
+
        if (given_config_source.file &&
                        !strcmp(given_config_source.file, "-")) {
                given_config_source.file = NULL;
@@ -661,7 +668,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        }
 
        if (HAS_MULTI_BITS(actions)) {
-               error("only one action at a time.");
+               error("only one action at a time");
                usage_with_options(builtin_config_usage, builtin_config_options);
        }
        if (actions == 0)
@@ -681,7 +688,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        if (show_origin && !(actions &
                (ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) {
                error("--show-origin is only applicable to --get, --get-all, "
-                         "--get-regexp, and --list.");
+                     "--get-regexp, and --list");
                usage_with_options(builtin_config_usage, builtin_config_options);
        }
 
@@ -816,7 +823,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                if (ret < 0)
                        return ret;
                if (ret == 0)
-                       die("No such section!");
+                       die("no such section: %s", argv[0]);
        }
        else if (actions == ACTION_REMOVE_SECTION) {
                int ret;
@@ -827,7 +834,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                if (ret < 0)
                        return ret;
                if (ret == 0)
-                       die("No such section!");
+                       die("no such section: %s", argv[0]);
        }
        else if (actions == ACTION_GET_COLOR) {
                check_argc(argc, 1, 2);