summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/apk.c b/src/apk.c
index 8ad4200..21e4359 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -23,9 +23,8 @@
const char *apk_root;
struct apk_repository_url apk_repository_list;
-int apk_verbosity = 1, apk_progress = 0, apk_upgrade = 0;
-int apk_clean = 0, apk_force = 0;
-int apk_cwd_fd;
+int apk_verbosity = 1, apk_cwd_fd;
+unsigned int apk_flags = 0;
void apk_log(const char *prefix, const char *format, ...)
{
@@ -111,16 +110,17 @@ static struct apk_repository_url *apk_repository_new(const char *url)
return r;
}
-#define NUM_GENERIC_OPTS 8
+#define NUM_GENERIC_OPTS 9
static struct option generic_options[32] = {
{ "root", required_argument, NULL, 'p' },
{ "repository", required_argument, NULL, 'X' },
{ "quiet", no_argument, NULL, 'q' },
{ "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
- { "progress", no_argument, &apk_progress, 1 },
- { "clean-protected", no_argument, &apk_clean, 1 },
- { "force", no_argument, &apk_force, 1 },
+ { "progress", no_argument, NULL, 0x101 },
+ { "clean-protected", no_argument, NULL, 0x102 },
+ { "force", no_argument, NULL, 0x103 },
+ { "simulate", no_argument, NULL, 0x104 },
};
int main(int argc, char **argv)
@@ -181,6 +181,17 @@ int main(int argc, char **argv)
break;
case 'V':
return version();
+ case 0x101:
+ apk_flags |= APK_PROGRESS;
+ break;
+ case 0x102:
+ apk_flags |= APK_CLEAN_PROTECTED;
+ break;
+ case 0x103:
+ apk_flags |= APK_FORCE;
+ break;
+ case 0x104:
+ apk_flags |= APK_SIMULATE;
break;
default:
if (applet == NULL || applet->parse == NULL)