Git fork
1#include "builtin.h"
2#include "gettext.h"
3#include "parse-options.h"
4#include "prune-packed.h"
5
6static const char * const prune_packed_usage[] = {
7 "git prune-packed [-n | --dry-run] [-q | --quiet]",
8 NULL
9};
10
11int cmd_prune_packed(int argc,
12 const char **argv,
13 const char *prefix,
14 struct repository *repo UNUSED)
15{
16 int opts = isatty(2) ? PRUNE_PACKED_VERBOSE : 0;
17 const struct option prune_packed_options[] = {
18 OPT_BIT('n', "dry-run", &opts, N_("dry run"),
19 PRUNE_PACKED_DRY_RUN),
20 OPT_NEGBIT('q', "quiet", &opts, N_("be quiet"),
21 PRUNE_PACKED_VERBOSE),
22 OPT_END()
23 };
24
25 argc = parse_options(argc, argv, prefix, prune_packed_options,
26 prune_packed_usage, 0);
27
28 if (argc > 0)
29 usage_msg_opt(_("too many arguments"),
30 prune_packed_usage,
31 prune_packed_options);
32
33 prune_packed_objects(opts);
34 return 0;
35}