summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorjakob <jakob@memeware.net>2017-01-14 16:49:23 -0500
committerjakob <jakob@memeware.net>2017-01-14 16:49:23 -0500
commitceda7715c02c25fd34628e1509e3c24fd3b49f31 (patch)
tree8117f84a4aa75db25dce52885f95d1a943ce470b /src/cli.c
parentd6a443127b6f8173aeab214942e0b6f31f7c4224 (diff)
Added quiet option.
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cli.c b/src/cli.c
index 11638a2..0c8dce8 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -37,7 +37,9 @@
" -a, --archive\tAlternate way of specifying archive" \
"to extract.\n" \
" -g, --game\t\tGame the archive is from. Required for " \
- "file decryption"
+ "file decryption\n" \
+ " -q, --quiet\t\tDon't display information about " \
+ "extracted files."
#define GAME_CONSTANTS "none, nekopara_volume_0, nekopara_volume_0_steam, " \
"nekopara_volume_1, nekopara_volume_1_steam"
@@ -47,7 +49,7 @@
struct configuration parse_args(int argc, char *argv[]) {
if (argc < 2) {
fprintf(stderr, "Usage: %s [OPTIONS] (ARCHIVE PATH)\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* The struct has to be zeroed out, otherwise argument parsing
@@ -62,11 +64,16 @@ struct configuration parse_args(int argc, char *argv[]) {
static struct option long_options[] = {
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'v'},
+ {"quiet", no_argument, NULL, 'q'},
+ {"extract", no_argument, NULL, 'e'},
+ {"list", no_argument, NULL, 'l'},
+ {"archive", required_argument, NULL, 'a'},
+ {"game", required_argument, NULL, 'g'},
{NULL, 0, NULL, 0}
};
do {
- current = getopt_long(argc, argv, "hvela:g:", long_options,
+ current = getopt_long(argc, argv, "hvelqa:g:", long_options,
&option_index);
switch (current) {
case 'h':
@@ -78,6 +85,9 @@ struct configuration parse_args(int argc, char *argv[]) {
printf("Nekopack, version %s\nProgrammed by "
"Jakob. <http://tsar-fox.com/>\n", VERSION);
exit(EXIT_SUCCESS);
+ case 'q':
+ parsed.quiet = 1;
+ break;
case 'a':
count++;
parsed.archive_path = optarg;