commit - 22ec3416ba9ee6c4c58dbc55e16d40157ed8e5f7
commit + 6f3190632709528909c1dc45046a2a85921584aa
blob - 49dd805c03a534e38d4a01d90a18f868676a58b6
blob + 1ff53d9f2259c53d193902d67d5cbf3c5c1fd1c7
--- got/got.c
+++ got/got.c
TAILQ_INIT(&ignores);
- while ((ch = getopt(argc, argv, "b:m:r:I:")) != -1) {
+ while ((ch = getopt(argc, argv, "b:I:m:r:")) != -1) {
switch (ch) {
case 'b':
branch_name = optarg;
break;
+ case 'I':
+ if (optarg[0] == '\0')
+ break;
+ error = got_pathlist_insert(&pe, &ignores, optarg,
+ NULL);
+ if (error)
+ goto done;
+ break;
case 'm':
logmsg = strdup(optarg);
if (logmsg == NULL) {
optarg);
goto done;
}
- break;
- case 'I':
- if (optarg[0] == '\0')
- break;
- error = got_pathlist_insert(&pe, &ignores, optarg,
- NULL);
- if (error)
- goto done;
break;
default:
usage_import();
TAILQ_INIT(&wanted_branches);
TAILQ_INIT(&wanted_refs);
- while ((ch = getopt(argc, argv, "ab:lmvqR:")) != -1) {
+ while ((ch = getopt(argc, argv, "ab:lmqR:v")) != -1) {
switch (ch) {
case 'a':
fetch_all_branches = 1;
case 'm':
mirror_references = 1;
break;
- case 'v':
- if (verbosity < 0)
- verbosity = 0;
- else if (verbosity < 3)
- verbosity++;
- break;
case 'q':
verbosity = -1;
break;
if (error)
return error;
break;
+ case 'v':
+ if (verbosity < 0)
+ verbosity = 0;
+ else if (verbosity < 3)
+ verbosity++;
+ break;
default:
usage_clone();
break;
TAILQ_INIT(&wanted_branches);
TAILQ_INIT(&wanted_refs);
- while ((ch = getopt(argc, argv, "ab:dlr:tvqR:X")) != -1) {
+ while ((ch = getopt(argc, argv, "ab:dlqR:r:tvX")) != -1) {
switch (ch) {
case 'a':
fetch_all_branches = 1;
break;
case 'l':
list_refs_only = 1;
+ break;
+ case 'q':
+ verbosity = -1;
+ break;
+ case 'R':
+ error = got_pathlist_append(&wanted_refs,
+ optarg, NULL);
+ if (error)
+ return error;
break;
case 'r':
repo_path = realpath(optarg, NULL);
verbosity = 0;
else if (verbosity < 3)
verbosity++;
- break;
- case 'q':
- verbosity = -1;
- break;
- case 'R':
- error = got_pathlist_append(&wanted_refs,
- optarg, NULL);
- if (error)
- return error;
break;
case 'X':
delete_remote = 1;
limit = get_default_log_limit();
- while ((ch = getopt(argc, argv, "bpPc:C:l:r:RsS:x:")) != -1) {
+ while ((ch = getopt(argc, argv, "bC:c:l:PpRr:S:sx:")) != -1) {
switch (ch) {
- case 'p':
- show_patch = 1;
+ case 'b':
+ log_branches = 1;
break;
- case 'P':
- show_changed_paths = 1;
- break;
- case 'c':
- start_commit = optarg;
- break;
case 'C':
diff_context = strtonum(optarg, 0, GOT_DIFF_MAX_CONTEXT,
&errstr);
errx(1, "number of context lines is %s: %s",
errstr, optarg);
break;
+ case 'c':
+ start_commit = optarg;
+ break;
case 'l':
limit = strtonum(optarg, 0, INT_MAX, &errstr);
if (errstr != NULL)
errx(1, "number of commits is %s: %s",
errstr, optarg);
break;
- case 'b':
- log_branches = 1;
+ case 'P':
+ show_changed_paths = 1;
break;
+ case 'p':
+ show_patch = 1;
+ break;
+ case 'R':
+ reverse_display_order = 1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
optarg);
got_path_strip_trailing_slashes(repo_path);
break;
- case 'R':
- reverse_display_order = 1;
+ case 'S':
+ search_pattern = optarg;
break;
case 's':
one_line = 1;
- break;
- case 'S':
- search_pattern = optarg;
break;
case 'x':
end_commit = optarg;
err(1, "pledge");
#endif
- while ((ch = getopt(argc, argv, "ac:C:r:swP")) != -1) {
+ while ((ch = getopt(argc, argv, "aC:c:Pr:sw")) != -1) {
switch (ch) {
case 'a':
force_text_diff = 1;
- break;
- case 'c':
- if (ncommit_args >= 2)
- errx(1, "too many -c options used");
- commit_args[ncommit_args++] = optarg;
break;
case 'C':
diff_context = strtonum(optarg, 0, GOT_DIFF_MAX_CONTEXT,
errx(1, "number of context lines is %s: %s",
errstr, optarg);
break;
+ case 'c':
+ if (ncommit_args >= 2)
+ errx(1, "too many -c options used");
+ commit_args[ncommit_args++] = optarg;
+ break;
+ case 'P':
+ force_path = 1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
break;
case 'w':
ignore_whitespace = 1;
- break;
- case 'P':
- force_path = 1;
break;
default:
usage_diff();
err(1, "pledge");
#endif
- while ((ch = getopt(argc, argv, "c:r:iR")) != -1) {
+ while ((ch = getopt(argc, argv, "c:iRr:")) != -1) {
switch (ch) {
case 'c':
commit_id_str = optarg;
+ break;
+ case 'i':
+ show_ids = 1;
break;
+ case 'R':
+ recurse = 1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
optarg);
got_path_strip_trailing_slashes(repo_path);
break;
- case 'i':
- show_ids = 1;
- break;
- case 'R':
- recurse = 1;
- break;
default:
usage_tree();
/* NOTREACHED */
st.status_codes = NULL;
st.suppress = 0;
- while ((ch = getopt(argc, argv, "Is:S:")) != -1) {
+ while ((ch = getopt(argc, argv, "IS:s:")) != -1) {
switch (ch) {
case 'I':
no_ignores = 1;
char *refname = NULL;
int *pack_fds = NULL;
- while ((ch = getopt(argc, argv, "c:dr:ls:t")) != -1) {
+ while ((ch = getopt(argc, argv, "c:dlr:s:t")) != -1) {
switch (ch) {
case 'c':
obj_arg = optarg;
case 'd':
do_delete = 1;
break;
+ case 'l':
+ do_list = 1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
optarg);
got_path_strip_trailing_slashes(repo_path);
break;
- case 'l':
- do_list = 1;
- break;
case 's':
symref_target = optarg;
break;
TAILQ_INIT(&paths);
- while ((ch = getopt(argc, argv, "c:d:r:lnt")) != -1) {
+ while ((ch = getopt(argc, argv, "c:d:lnr:t")) != -1) {
switch (ch) {
case 'c':
commit_id_arg = optarg;
case 'd':
delref = optarg;
break;
+ case 'l':
+ do_list = 1;
+ break;
+ case 'n':
+ do_update = 0;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
optarg);
got_path_strip_trailing_slashes(repo_path);
break;
- case 'l':
- do_list = 1;
- break;
- case 'n':
- do_update = 0;
- break;
case 't':
sort_by_time = 1;
break;
int ch, do_list = 0, verify_tags = 0, verbosity = 0;
int *pack_fds = NULL;
- while ((ch = getopt(argc, argv, "c:m:r:ls:Vv")) != -1) {
+ while ((ch = getopt(argc, argv, "c:lm:r:s:Vv")) != -1) {
switch (ch) {
case 'c':
commit_id_arg = optarg;
break;
+ case 'l':
+ do_list = 1;
+ break;
case 'm':
tagmsg = optarg;
break;
goto done;
}
got_path_strip_trailing_slashes(repo_path);
- break;
- case 'l':
- do_list = 1;
break;
case 's':
signer_id = strdup(optarg);
TAILQ_INIT(&paths);
- while ((ch = getopt(argc, argv, "pF:R")) != -1) {
+ while ((ch = getopt(argc, argv, "F:pR")) != -1) {
switch (ch) {
- case 'p':
- pflag = 1;
- break;
case 'F':
patch_script_path = optarg;
break;
+ case 'p':
+ pflag = 1;
+ break;
case 'R':
can_recurse = 1;
break;
TAILQ_INIT(&delete_args);
TAILQ_INIT(&delete_branches);
- while ((ch = getopt(argc, argv, "ab:d:fr:t:Tvq")) != -1) {
+ while ((ch = getopt(argc, argv, "ab:d:fqr:Tt:v")) != -1) {
switch (ch) {
case 'a':
send_all_branches = 1;
case 'f':
overwrite_refs = 1;
break;
+ case 'q':
+ verbosity = -1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
optarg);
got_path_strip_trailing_slashes(repo_path);
break;
+ case 'T':
+ send_all_tags = 1;
+ break;
case 't':
error = got_pathlist_append(&tags, optarg, NULL);
if (error)
return error;
break;
- case 'T':
- send_all_tags = 1;
- break;
case 'v':
if (verbosity < 0)
verbosity = 0;
else if (verbosity < 3)
verbosity++;
- break;
- case 'q':
- verbosity = -1;
break;
default:
usage_send();
TAILQ_INIT(&merged_paths);
memset(&upa, 0, sizeof(upa));
- while ((ch = getopt(argc, argv, "acefF:mlX")) != -1) {
+ while ((ch = getopt(argc, argv, "aceF:flmX")) != -1) {
switch (ch) {
case 'a':
abort_edit = 1;
case 'e':
edit_only = 1;
break;
- case 'f':
- fold_only = 1;
- break;
case 'F':
edit_script_path = optarg;
break;
- case 'm':
- edit_logmsg_only = 1;
+ case 'f':
+ fold_only = 1;
break;
case 'l':
list_backups = 1;
break;
+ case 'm':
+ edit_logmsg_only = 1;
+ break;
case 'X':
delete_backups = 1;
break;
TAILQ_INIT(&paths);
- while ((ch = getopt(argc, argv, "lpF:S")) != -1) {
+ while ((ch = getopt(argc, argv, "F:lpS")) != -1) {
switch (ch) {
+ case 'F':
+ patch_script_path = optarg;
+ break;
case 'l':
list_stage = 1;
break;
case 'p':
pflag = 1;
break;
- case 'F':
- patch_script_path = optarg;
- break;
case 'S':
allow_bad_symlinks = 1;
break;
TAILQ_INIT(&paths);
- while ((ch = getopt(argc, argv, "pF:")) != -1) {
+ while ((ch = getopt(argc, argv, "F:p")) != -1) {
switch (ch) {
- case 'p':
- pflag = 1;
- break;
case 'F':
patch_script_path = optarg;
break;
+ case 'p':
+ pflag = 1;
+ break;
default:
usage_unstage();
/* NOTREACHED */
err(1, "pledge");
#endif
- while ((ch = getopt(argc, argv, "c:r:P")) != -1) {
+ while ((ch = getopt(argc, argv, "c:Pr:")) != -1) {
switch (ch) {
case 'c':
commit_id_str = optarg;
break;
+ case 'P':
+ force_path = 1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
optarg);
got_path_strip_trailing_slashes(repo_path);
break;
- case 'P':
- force_path = 1;
- break;
default:
usage_cat();
/* NOTREACHED */
blob - e52fbe0e7a683a76482f59effaf3fc58cfcaf0d6
blob + aca013eba6083c114897f57932c5b1565d61bf14
--- gotadmin/gotadmin.c
+++ gotadmin/gotadmin.c
TAILQ_INIT(&exclude_refs);
TAILQ_INIT(&include_refs);
- while ((ch = getopt(argc, argv, "ar:x:q")) != -1) {
+ while ((ch = getopt(argc, argv, "aqr:x:")) != -1) {
switch (ch) {
case 'a':
loose_obj_only = 0;
break;
+ case 'q':
+ verbosity = -1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
if (error)
return error;
break;
- case 'q':
- verbosity = -1;
- break;
default:
usage_pack();
/* NOTREACHED */
error = add_ref(&new, &exclude_refs, refname, repo);
if (error)
goto done;
-
}
if (argc == 0) {
int nextensions, i;
int *pack_fds = NULL;
- while ((ch = getopt(argc, argv, "apr:nq")) != -1) {
+ while ((ch = getopt(argc, argv, "anpqr:")) != -1) {
switch (ch) {
case 'a':
ignore_mtime = 1;
break;
+ case 'n':
+ dry_run = 1;
+ break;
case 'p':
remove_lonely_packidx = 1;
break;
+ case 'q':
+ verbosity = -1;
+ break;
case 'r':
repo_path = realpath(optarg, NULL);
if (repo_path == NULL)
optarg);
got_path_strip_trailing_slashes(repo_path);
break;
- case 'n':
- dry_run = 1;
- break;
- case 'q':
- verbosity = -1;
- break;
default:
usage_cleanup();
/* NOTREACHED */
blob - 48d6a4292538e6aa276672b3ec748f17b141b940
blob + 4e94e74827b4a318903802c2324b5b653b29e5bd
--- gotd/gotd.c
+++ gotd/gotd.c
log_init(1, LOG_DAEMON); /* Log to stderr until daemonized. */
- while ((ch = getopt(argc, argv, "df:nvRWP:")) != -1) {
+ while ((ch = getopt(argc, argv, "df:nP:RvW")) != -1) {
switch (ch) {
case 'd':
daemonize = 0;
case 'n':
noaction = 1;
break;
- case 'v':
- if (verbosity < 3)
- verbosity++;
+ case 'P':
+ repo_path = realpath(optarg, NULL);
+ if (repo_path == NULL)
+ fatal("realpath '%s'", optarg);
break;
case 'R':
proc_id = PROC_REPO_READ;
break;
+ case 'v':
+ if (verbosity < 3)
+ verbosity++;
+ break;
case 'W':
proc_id = PROC_REPO_WRITE;
break;
- case 'P':
- repo_path = realpath(optarg, NULL);
- if (repo_path == NULL)
- fatal("realpath '%s'", optarg);
- break;
default:
usage();
}
blob - 38c11329e49c68c35dbf2decefe120e7c1f83e0d
blob + cc0a4954a61a219297305919f2441a682fcb9a78
--- gotwebd/gotwebd.c
+++ gotwebd/gotwebd.c
fatal("%s: calloc", __func__);
/* XXX: add s and S for both sockets */
- while ((ch = getopt(argc, argv, "D:P:I:df:vn")) != -1) {
+ while ((ch = getopt(argc, argv, "D:df:I:nP:v")) != -1) {
switch (ch) {
case 'D':
if (cmdline_symset(optarg) < 0)
case 'f':
conffile = optarg;
break;
- case 'v':
- env->gotwebd_verbose++;
+ case 'I':
+ proc_instance = strtonum(optarg, 0,
+ PROC_MAX_INSTANCES, &errp);
+ if (errp)
+ fatalx("invalid process instance");
break;
case 'n':
env->gotwebd_debug = 2;
if (proc_id == PROC_MAX)
fatalx("invalid process name");
break;
- case 'I':
- proc_instance = strtonum(optarg, 0,
- PROC_MAX_INSTANCES, &errp);
- if (errp)
- fatalx("invalid process instance");
+ case 'v':
+ env->gotwebd_verbose++;
break;
default:
usage();
blob - c0e71877fd2d42e62b12140d90a427fecf8d0cee
blob + 8bf54464cab24b0793ad1c92d1085212a09dc526
--- regress/fetch/fetch_test.c
+++ regress/fetch/fetch_test.c
err(1, "pledge");
#endif
- while ((ch = getopt(argc, argv, "vq")) != -1) {
+ while ((ch = getopt(argc, argv, "qv")) != -1) {
switch (ch) {
- case 'v':
- verbose = 1;
- quiet = 0;
- break;
case 'q':
quiet = 1;
verbose = 0;
break;
+ case 'v':
+ verbose = 1;
+ quiet = 0;
+ break;
default:
usage();
return 1;
blob - 920e69e004d588ab238d738e0915a89dc67bf9eb
blob + f473bd34c3797403a9a540f9222323c574a6d2d6
--- regress/idset/idset_test.c
+++ regress/idset/idset_test.c
err(1, "pledge");
#endif
- while ((ch = getopt(argc, argv, "vq")) != -1) {
+ while ((ch = getopt(argc, argv, "qv")) != -1) {
switch (ch) {
- case 'v':
- verbose = 1;
- quiet = 0;
- break;
case 'q':
quiet = 1;
verbose = 0;
break;
+ case 'v':
+ verbose = 1;
+ quiet = 0;
+ break;
default:
usage();
return 1;
blob - bbf71a79eb4fa68027df6f06b7a1d9926000a518
blob + 1b4e2a08ae74cbaca233fe92241caa8848454f5d
--- regress/path/path_test.c
+++ regress/path/path_test.c
err(1, "pledge");
#endif
- while ((ch = getopt(argc, argv, "vq")) != -1) {
+ while ((ch = getopt(argc, argv, "qv")) != -1) {
switch (ch) {
- case 'v':
- verbose = 1;
- quiet = 0;
- break;
case 'q':
quiet = 1;
verbose = 0;
break;
+ case 'v':
+ verbose = 1;
+ quiet = 0;
+ break;
default:
usage();
return 1;
blob - 5e848211fb214dcf85821630b0ddfec124dc7502
blob + 3b4eac348bb9ce1af38f8f5b5a1aeb8f54b83e14
--- util/got-build-regress.sh
+++ util/got-build-regress.sh
force=0
testroot="/tmp"
-args=`getopt b:fw:r:R: $*`
+args=`getopt b:fR:r:w: $*`
if [ $? -ne 0 ]
then
echo "usage: $usage" >&2