| 831 | } |
| 832 | |
| 833 | int cmd_version(int argc, const char **argv, const char *prefix, struct repository *repository UNUSED) |
| 834 | { |
| 835 | struct strbuf buf = STRBUF_INIT; |
| 836 | int build_options = 0; |
| 837 | const char * const usage[] = { |
| 838 | N_("git version [--build-options]"), |
| 839 | NULL |
| 840 | }; |
| 841 | struct option options[] = { |
| 842 | OPT_BOOL(0, "build-options", &build_options, |
| 843 | "also print build options"), |
| 844 | OPT_END() |
| 845 | }; |
| 846 | |
| 847 | argc = parse_options(argc, argv, prefix, options, usage, 0); |
| 848 | |
| 849 | get_version_info(&buf, build_options); |
| 850 | printf("%s", buf.buf); |
| 851 | |
| 852 | strbuf_release(&buf); |
| 853 | |
| 854 | return 0; |
| 855 | } |
| 856 | |
| 857 | struct similar_ref_cb { |
| 858 | const char *base_ref; |
nothing calls this directly
no test coverage detected