Stephen Boyd | c2e86ad | 2011-03-22 00:51:05 -0700 | [diff] [blame] | 1 | #include "builtin.h" |
Pierre Habouzit | b2565ae | 2007-10-15 23:06:02 +0200 | [diff] [blame] | 2 | #include "parse-options.h" |
Johan Herland | 94e724a | 2008-06-15 16:05:06 +0200 | [diff] [blame] | 3 | #include "pack-refs.h" |
Linus Torvalds | 99b5a79 | 2007-05-26 09:25:31 -0700 | [diff] [blame] | 4 | |
Pierre Habouzit | b2565ae | 2007-10-15 23:06:02 +0200 | [diff] [blame] | 5 | static char const * const pack_refs_usage[] = { |
Nguyễn Thái Ngọc Duy | e08b735 | 2012-08-20 19:32:30 +0700 | [diff] [blame] | 6 | N_("git pack-refs [options]"), |
Pierre Habouzit | b2565ae | 2007-10-15 23:06:02 +0200 | [diff] [blame] | 7 | NULL |
| 8 | }; |
| 9 | |
Linus Torvalds | 99b5a79 | 2007-05-26 09:25:31 -0700 | [diff] [blame] | 10 | int cmd_pack_refs(int argc, const char **argv, const char *prefix) |
| 11 | { |
Pierre Habouzit | 68dce6e | 2007-11-07 11:20:30 +0100 | [diff] [blame] | 12 | unsigned int flags = PACK_REFS_PRUNE; |
Pierre Habouzit | b2565ae | 2007-10-15 23:06:02 +0200 | [diff] [blame] | 13 | struct option opts[] = { |
Nguyễn Thái Ngọc Duy | e08b735 | 2012-08-20 19:32:30 +0700 | [diff] [blame] | 14 | OPT_BIT(0, "all", &flags, N_("pack everything"), PACK_REFS_ALL), |
| 15 | OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE), |
Pierre Habouzit | b2565ae | 2007-10-15 23:06:02 +0200 | [diff] [blame] | 16 | OPT_END(), |
| 17 | }; |
Stephen Boyd | 3778292 | 2009-05-23 11:53:12 -0700 | [diff] [blame] | 18 | if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0)) |
Pierre Habouzit | b2565ae | 2007-10-15 23:06:02 +0200 | [diff] [blame] | 19 | usage_with_options(pack_refs_usage, opts); |
Linus Torvalds | 99b5a79 | 2007-05-26 09:25:31 -0700 | [diff] [blame] | 20 | return pack_refs(flags); |
| 21 | } |