summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-06-17 18:06:48 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-06-17 18:18:48 (EDT)
commit3bec9be0e3d64eb6c4f9aa32d94cdcde88c7395c (patch)
tree258434dfb05c4b565a142b99828d061fe6e42cd2
parent72cbc7b243326be13f986dd160e7e69a38d5b869 (diff)
main: Add -s option
-rw-r--r--src/main.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 4a672b2..01b5d0a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -36,7 +36,7 @@
extern const char *PACKAGE_VERSION_GIT;
-const char *_optstring = "bc:d:f:F:lLhV";
+const char *_optstring = "bc:d:s:f:F:lLhV";
#ifdef HAVE_GETOPT_LONG
struct option _longopts[] = {
{
@@ -58,6 +58,12 @@ struct option _longopts[] = {
.val = 'd',
},
{
+ .name = "special",
+ .has_arg = 1,
+ .flag = NULL,
+ .val = 's',
+ },
+ {
.name = "control-file",
.has_arg = 1,
.flag = NULL,
@@ -101,7 +107,8 @@ _help(const char *program_name)
{
printf(_("Usage: %s [-c CONTROL-DIR] [-f CONTROL-FILE] [-F DATA-FILE] "
"[-l] [-L] PACKAGE\n"), program_name);
- printf(_(" or: %s -b -c CONTROL-DIR -d DATA-DIR PACKAGE\n"),
+ printf(_(" or: %s -b -c CONTROL-DIR -d DATA-DIR [-s SPECIAL-FILE] "
+ "PACKAGE\n"),
program_name);
#ifdef HAVE_GETOPT_LONG
puts(_("Options:\n"
@@ -112,6 +119,8 @@ _help(const char *program_name)
" files into CONTROL-DIR.\n"
" -d, --data-dir=DATA-DIR In build mode, read data files from "
"DATA-DIR\n"
+" -s, --special=SPECIAL-FILE Read device special files list from\n"
+" SPECIAL-FILE.\n"
" -f, --control-file=CONTROL-FILE Print the contents of the named control "
"file.\n"
" If this option is given multiple times, the"
@@ -146,6 +155,7 @@ _help(const char *program_name)
"\n"
" control files into CONTROL-DIR.\n"
" -d In build mode, read data files from DATA-DIR\n"
+" -s Read device special files list from SPECIAL-FILE.\n"
" -f Print the contents of the named control file. If this option is given\n"
" multiple times, the named control files will be printed in the order "
"they\n"
@@ -253,6 +263,9 @@ main(int argc, char *argv[])
case 'd':
opkg_opk_opk_data_dir(opk, optarg);
break;
+ case 's':
+ opkg_opk_opk_specials_read(opk, optarg);
+ break;
case 'f':
if (opt_l > 0) {
_opt_mutex(program_name, 'f', 'l');