125
{ OPTION_CALLBACK, (s), (l), (v), NULL, (h), PARSE_OPT_NOARG | \
126
PARSE_OPT_NONEG, option_parse_type, (i) }
127
128
-static NORETURN void usage_builtin_config(void);
129
-
128
static int option_parse_type(const struct option *opt, const char *arg,
129
int unset)
130
{
169
* --type=int'.
170
*/
171
error(_("only one type at a time"));
174
- usage_builtin_config();
172
+ exit(129);
173
}
174
*to_type = new_type;
175
185
else
186
error(_("wrong number of arguments, should be from %d to %d"),
187
min, max);
190
- usage_builtin_config();
188
+ exit(129);
189
}
190
191
static void show_config_origin(const struct key_value_info *kvi,
670
use_worktree_config +
671
!!given_config_source.file + !!given_config_source.blob > 1) {
672
error(_("only one config file at a time"));
675
- usage_builtin_config();
673
+ exit(129);
674
}
675
676
if (!startup_info->have_repository) {
800
OPT_END(),
801
};
802
805
-static NORETURN void usage_builtin_config(void)
806
-{
807
- usage_with_options(builtin_config_usage, builtin_config_options);
808
-}
809
-
803
static int cmd_config_list(int argc, const char **argv, const char *prefix)
804
{
805
struct option opts[] = {
1103
1104
if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && type) {
1105
error(_("--get-color and variable type are incoherent"));
1113
- usage_builtin_config();
1106
+ exit(129);
1107
}
1108
1109
if (actions == 0)
1112
case 2: actions = ACTION_SET; break;
1113
case 3: actions = ACTION_SET_ALL; break;
1114
default:
1122
- usage_builtin_config();
1115
+ error(_("no action specified"));
1116
+ exit(129);
1117
}
1118
if (omit_values &&
1119
!(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) {
1120
error(_("--name-only is only applicable to --list or --get-regexp"));
1127
- usage_builtin_config();
1121
+ exit(129);
1122
}
1123
1124
if (show_origin && !(actions &
1125
(ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) {
1126
error(_("--show-origin is only applicable to --get, --get-all, "
1127
"--get-regexp, and --list"));
1134
- usage_builtin_config();
1128
+ exit(129);
1129
}
1130
1131
if (default_value && !(actions & ACTION_GET)) {
1132
error(_("--default is only applicable to --get"));
1139
- usage_builtin_config();
1133
+ exit(129);
1134
}
1135
1136
if (comment_arg &&
1137
!(actions & (ACTION_ADD|ACTION_SET|ACTION_SET_ALL|ACTION_REPLACE_ALL))) {
1138
error(_("--comment is only applicable to add/set/replace operations"));
1145
- usage_builtin_config();
1139
+ exit(129);
1140
}
1141
1142
/* check usage of --fixed-value */
1169
1170
if (!allowed_usage) {
1171
error(_("--fixed-value only applies with 'value-pattern'"));
1178
- usage_builtin_config();
1172
+ exit(129);
1173
}
1174
1175
flags |= CONFIG_FLAGS_FIXED_VALUE;