On Fri, Aug 19 2022, SZEDER Gábor wrote: > + parse_opt_subcommand_fn *fn = NULL; Re the comment on notes.c this is a bit like that pattern... > -log_reflog: > - return cmd_log_reflog(argc, argv, prefix); > + PARSE_OPT_KEEP_UNKNOWN_OPT); > + if (fn) > + return fn(argc - 1, argv + 1, prefix); > + else > + return cmd_log_reflog(argc, argv, prefix); > } Maybe more obvious (untested): if (!fn) { argc--; argv++; fn = cmd_log_reflog; } return fn(argc, argv, prefix);