diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-04-29 18:55:16 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-04-29 18:55:16 (EDT) |
commit | f217727c24c3cf1ec566a888ef409302377bb8d3 (patch) | |
tree | 4a168285572a278b819df783b778aad6d43792f7 /src/main.c | |
parent | 6c956aef8ec09be9fafaec495145b5f64df678b9 (diff) |
opk: Extract control files
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -36,10 +36,16 @@ extern const char *PACKAGE_VERSION_GIT; -const char *_optstring = "f:F:lLhV"; +const char *_optstring = "c:f:F:lLhV"; #ifdef HAVE_GETOPT_LONG struct option _longopts[] = { { + .name = "control-dir", + .has_arg = 1, + .flag = NULL, + .val = 'c', + }, + { .name = "control-file", .has_arg = 1, .flag = NULL, @@ -81,10 +87,11 @@ struct option _longopts[] = { static void _help(const char *program_name) { - printf(_("Usage: %s [-f CONTROL-FILE] [-F DATA-FILE] [-l] [-L] " - "PACKAGE\n"), program_name); + printf(_("Usage: %s [-c CONTROL-DIR] [-f CONTROL-FILE] [-F DATA-FILE] " + "[-l] [-L] PACKAGE\n"), program_name); #ifdef HAVE_GETOPT_LONG puts(_("Options:\n" +" -c, --control-dir=CONTROL-DIR Extract control files into CONTROL-DIR.\n" " -f, --control-file=CONTROL-FILE Print the contents of the named control " "file.\n" " If this option is given multiple times, the" @@ -210,6 +217,9 @@ main(int argc, char *argv[]) while ((opt = getopt(argc, argv, _optstring)) != -1) { #endif switch(opt) { + case 'c': + opkg_opk_opk_control_dir(opk, optarg); + break; case 'f': if (opt_l > 0) { _opt_mutex(program_name, 'f', 'l'); |