int lg2_tag(git_repository *repo, int argc, char **argv) { tag_options opts; tag_action action; tag_state state; tag_options_init(&opts); parse_options(&action, &opts, argc, argv); state.repo = repo; state.opts = &opts; action(&state); return 0; }
int main(int argc, char **argv) { git_repository *repo; tag_options opts; tag_action action; tag_state state; git_threads_init(); check_lg2(git_repository_open_ext(&repo, ".", 0, NULL), "Could not open repository", NULL); tag_options_init(&opts); parse_options(&action, &opts, argc, argv); state.repo = repo; state.opts = &opts; action(&state); git_repository_free(repo); git_threads_shutdown(); return 0; }