summaryrefslogtreecommitdiff
path: root/src/app_upgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app_upgrade.c')
-rw-r--r--src/app_upgrade.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/app_upgrade.c b/src/app_upgrade.c
index 06008f6..b666d8e 100644
--- a/src/app_upgrade.c
+++ b/src/app_upgrade.c
@@ -24,21 +24,14 @@ struct upgrade_ctx {
int errors;
};
-enum {
- OPT_UPGRADE_available,
- OPT_UPGRADE_ignore,
- OPT_UPGRADE_latest,
- OPT_UPGRADE_no_self_upgrade,
- OPT_UPGRADE_self_upgrade_only,
-};
-
-static const char option_desc[] =
- APK_OPTAPPLET
- APK_OPT2n("available", "a")
- APK_OPT1n("ignore")
- APK_OPT2n("latest", "l")
- APK_OPT1n("no-self-upgrade")
- APK_OPT1n("self-upgrade-only");
+#define UPGRADE_OPTIONS(OPT) \
+ OPT(OPT_UPGRADE_available, APK_OPT_SH("a") "available") \
+ OPT(OPT_UPGRADE_ignore, "ignore") \
+ OPT(OPT_UPGRADE_latest, APK_OPT_SH("l") "latest") \
+ OPT(OPT_UPGRADE_no_self_upgrade, "no-self-upgrade") \
+ OPT(OPT_UPGRADE_self_upgrade_only, "self-upgrade-only")
+
+APK_OPT_APPLET(option_desc, UPGRADE_OPTIONS);
static int option_parse_applet(void *ctx, struct apk_db_options *dbopts, int opt, const char *optarg)
{