| 969 | } |
| 970 | |
| 971 | static int cmd_version(int argc, const char **argv) |
| 972 | { |
| 973 | int verbose = 0, build_options = 0; |
| 974 | struct option options[] = { |
| 975 | OPT__VERBOSE(&verbose, N_("include Git version")), |
| 976 | OPT_BOOL(0, "build-options", &build_options, |
| 977 | N_("include Git's build options")), |
| 978 | OPT_END(), |
| 979 | }; |
| 980 | const char * const usage[] = { |
| 981 | N_("scalar verbose [-v | --verbose] [--build-options]"), |
| 982 | NULL |
| 983 | }; |
| 984 | struct strbuf buf = STRBUF_INIT; |
| 985 | |
| 986 | argc = parse_options(argc, argv, NULL, options, |
| 987 | usage, 0); |
| 988 | |
| 989 | if (argc != 0) |
| 990 | usage_with_options(usage, options); |
| 991 | |
| 992 | get_version_info(&buf, build_options); |
| 993 | fprintf(stderr, "%s\n", buf.buf); |
| 994 | strbuf_release(&buf); |
| 995 | |
| 996 | return 0; |
| 997 | } |
| 998 | |
| 999 | static struct { |
| 1000 | const char *name; |
nothing calls this directly
no test coverage detected