summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/cli.c b/src/cli.c
index 481aaea..2713fed 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -24,13 +24,20 @@
#include "cli.h"
#include "defs.h"
-#define VERSION "0.1.0"
+#define VERSION "1.0.0.rc1"
#define HELP_TEXT "A tool for decompressing the XP3 archives used by " \
"Nekopara.\n\n" \
" -h, --help\t\tDisplay this help page and " \
"exit.\n" \
" -v, --version\tDisplay the currently installed " \
- "version and exit.\n\n"
+ "version and exit.\n\n" \
+ " -l, --list\t\tList games supported by Nekopack.\n" \
+ " -a, --archive\tAlternate way of specifying archive" \
+ "to extract.\n" \
+ " -g, --game\t\tGame the archive is from. Required for " \
+ "file decryption"
+#define GAME_CONSTANTS "none, nekopara_volume_0, nekopara_volume_0_steam, " \
+ "nekopara_volume_1, nekopara_volume_1_steam"
/* General subroutine for parsing command-line arguments. Returns a
@@ -57,7 +64,8 @@ struct configuration parse_args(int argc, char *argv[]) {
};
do {
- current = getopt_long(argc, argv, "hv", long_options, &option_index);
+ current = getopt_long(argc, argv, "hvla:g:", long_options,
+ &option_index);
switch (current) {
case 'h':
printf("Usage: %s [OPTIONS] (ARCHIVE PATH)\n\n", argv[0]);
@@ -67,6 +75,25 @@ 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 'l':
+ printf("%s\n", GAME_CONSTANTS);
+ exit(EXIT_SUCCESS);
+ case 'a':
+ count++;
+ parsed.archive_path = optarg;
+ break;
+ case 'g':
+ count++;
+ if (!strcmp(optarg, "nekopara_volume_0"))
+ parsed.source = NEKOPARA_VOLUME_0;
+ else if (!strcmp(optarg, "nekopara_volume_0_steam"))
+ parsed.source = NEKOPARA_VOLUME_0_STEAM;
+ else if (!strcmp(optarg, "nekopara_volume_1"))
+ parsed.source = NEKOPARA_VOLUME_1;
+ else if (!strcmp(optarg, "nekopara_volume_1_steam"))
+ parsed.source = NEKOPARA_VOLUME_1_STEAM;
+ else
+ parsed.source = NO_CRYPTO;
}
count++;
} while (current >= 0);