MCPcopy Create free account
hub / github.com/git/git / cmd_version

Function cmd_version

scalar.c:971–997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971static 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
999static struct {
1000 const char *name;

Callers

nothing calls this directly

Calls 4

parse_optionsFunction · 0.85
usage_with_optionsFunction · 0.85
get_version_infoFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected