diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-03-25 16:05:52 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-03-25 16:05:52 -0700 |
| commit | 852e2c84f847d99e29fd08feb8cea881dca63c79 (patch) | |
| tree | 20190f12233f00373df4760c8ddb300f848d19d4 /parse-options.c | |
| parent | 45fe28c951c3e70666ee4ef8379772851a8e4d32 (diff) | |
| parent | a3dfe97f418762ccf1d0601c5cce40c77046d4fc (diff) | |
| download | git-852e2c84f847d99e29fd08feb8cea881dca63c79.tar.xz | |
Merge branch 'jh/builtin-fsmonitor-part2' into jh/builtin-fsmonitor-part3
* jh/builtin-fsmonitor-part2: (150 commits)
t7527: test status with untracked-cache and fsmonitor--daemon
fsmonitor: force update index after large responses
fsmonitor--daemon: use a cookie file to sync with file system
fsmonitor--daemon: periodically truncate list of modified files
t/perf/p7519: add fsmonitor--daemon test cases
t/perf/p7519: speed up test on Windows
t/perf/p7519: fix coding style
t/helper/test-chmtime: skip directories on Windows
t/perf: avoid copying builtin fsmonitor files into test repo
t7527: create test for fsmonitor--daemon
t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon
help: include fsmonitor--daemon feature flag in version info
fsmonitor--daemon: implement handle_client callback
compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS
compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent
compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Windows
fsmonitor--daemon: create token-based changed path cache
fsmonitor--daemon: define token-ids
fsmonitor--daemon: add pathname classification
fsmonitor--daemon: implement 'start' command
...
Diffstat (limited to 'parse-options.c')
| -rw-r--r-- | parse-options.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c index 2437ad3bcd..6e57744fd2 100644 --- a/parse-options.c +++ b/parse-options.c @@ -1092,3 +1092,37 @@ void NORETURN usage_msg_optf(const char * const fmt, usage_msg_opt(msg.buf, usagestr, options); } + +void die_for_incompatible_opt4(int opt1, const char *opt1_name, + int opt2, const char *opt2_name, + int opt3, const char *opt3_name, + int opt4, const char *opt4_name) +{ + int count = 0; + const char *options[4]; + + if (opt1) + options[count++] = opt1_name; + if (opt2) + options[count++] = opt2_name; + if (opt3) + options[count++] = opt3_name; + if (opt4) + options[count++] = opt4_name; + switch (count) { + case 4: + die(_("options '%s', '%s', '%s', and '%s' cannot be used together"), + opt1_name, opt2_name, opt3_name, opt4_name); + break; + case 3: + die(_("options '%s', '%s', and '%s' cannot be used together"), + options[0], options[1], options[2]); + break; + case 2: + die(_("options '%s' and '%s' cannot be used together"), + options[0], options[1]); + break; + default: + break; + } +} |
