MCPcopy Index your code
hub / github.com/git/git / parse_archive_args

Function parse_archive_args

archive.c:633–750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

631}
632
633static int parse_archive_args(int argc, const char **argv,
634 const struct archiver **ar, struct archiver_args *args,
635 const char *name_hint, int is_remote)
636{
637 const char *format = NULL;
638 const char *base = NULL;
639 const char *remote = NULL;
640 const char *exec = NULL;
641 const char *output = NULL;
642 const char *mtime_option = NULL;
643 int compression_level = -1;
644 int verbose = 0;
645 int i;
646 int list = 0;
647 int worktree_attributes = 0;
648 struct option opts[] = {
649 OPT_GROUP(""),
650 OPT_STRING(0, "format", &format, N_("fmt"), N_("archive format")),
651 OPT_STRING(0, "prefix", &base, N_("prefix"),
652 N_("prepend prefix to each pathname in the archive")),
653 {
654 .type = OPTION_CALLBACK,
655 .long_name = "add-file",
656 .value = args,
657 .argh = N_("file"),
658 .help = N_("add untracked file to archive"),
659 .callback = add_file_cb,
660 .defval = (intptr_t) &base,
661 },
662 {
663 .type = OPTION_CALLBACK,
664 .long_name = "add-virtual-file",
665 .value = args,
666 .argh = N_("path:content"),
667 .help = N_("add untracked file to archive"),
668 .callback = add_file_cb,
669 .defval = (intptr_t) &base,
670 },
671 OPT_STRING('o', "output", &output, N_("file"),
672 N_("write the archive to this file")),
673 OPT_BOOL(0, "worktree-attributes", &worktree_attributes,
674 N_("read .gitattributes in working directory")),
675 OPT__VERBOSE(&verbose, N_("report archived files on stderr")),
676 {
677 .type = OPTION_STRING,
678 .long_name = "mtime",
679 .value = &mtime_option,
680 .argh = N_("time"),
681 .help = N_("set modification time of archive entries"),
682 .flags = PARSE_OPT_NONEG,
683 },
684 OPT_NUMBER_CALLBACK(&compression_level,
685 N_("set compression level"), number_callback),
686 OPT_GROUP(""),
687 OPT_BOOL('l', "list", &list,
688 N_("list supported archive formats")),
689 OPT_GROUP(""),
690 OPT_STRING(0, "remote", &remote, N_("repo"),

Callers 1

write_archiveFunction · 0.85

Calls 5

parse_optionsFunction · 0.85
usage_with_optionsFunction · 0.85
lookup_archiverFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected