mirror of
https://github.com/xHyroM/gimi.git
synced 2024-11-21 23:41:06 +01:00
refactor: remove OPTION_WITH_ARG
This commit is contained in:
parent
f61fa52851
commit
aaabf9edeb
2 changed files with 4 additions and 10 deletions
|
@ -13,15 +13,9 @@
|
|||
argc -= optind; \
|
||||
argv += optind;
|
||||
|
||||
#define OPTION(opt, func) \
|
||||
#define OPTION(opt, func, ...) \
|
||||
case opt: { \
|
||||
func(); \
|
||||
break; \
|
||||
}
|
||||
|
||||
#define OPTION_WITH_ARG(opt, func, arg) \
|
||||
case opt: { \
|
||||
func(arg); \
|
||||
func(__VA_ARGS__); \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
|
|
@ -80,8 +80,8 @@ int cli_command_push(int argc, char **argv) {
|
|||
bool verbose = false;
|
||||
|
||||
HANDLE_OPTIONS(argc, argv, "tv",
|
||||
OPTION_WITH_ARG('t', set_tags, &tags)
|
||||
OPTION_WITH_ARG('v', set_verbose, &verbose));
|
||||
OPTION('t', set_tags, &tags)
|
||||
OPTION('v', set_verbose, &verbose));
|
||||
|
||||
char *branch_name = get_current_branch_name();
|
||||
|
||||
|
|
Loading…
Reference in a new issue