summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 2c3fa87..08be875 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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');