list: sort options alphabetically

cute-signatures
Timo Teräs 2021-12-27 10:34:17 +02:00
parent f3fc0105f8
commit 6117de6eae
2 changed files with 22 additions and 22 deletions

View File

@ -18,26 +18,26 @@ globbing.
# OPTIONS
*-I, --installed*
Consider only installed packages.
*-O, --orphaned*
Consider only orphaned packages.
*-a, --available*
Consider only available packages.
*-u, --upgradable, --upgradeable*
Consider only upgradable packages.
*-o, --origin*
List packages by origin.
*-d, --depends*
List packages by dependency.
*-P, --providers*
List packages by provider.
*-I, --installed*
Consider only installed packages.
*--manifest*
List installed packages in format `<name> <version>`.
*-o, --origin*
List packages by origin.
*-O, --orphaned*
Consider only orphaned packages.
*-P, --providers*
List packages by provider.
*-u, --upgradable, --upgradeable*
Consider only upgradable packages.

View File

@ -183,13 +183,13 @@ static void print_result(struct apk_database *db, const char *match, struct apk_
#define LIST_OPTIONS(OPT) \
OPT(OPT_LIST_available, APK_OPT_SH("a") "available") \
OPT(OPT_LIST_installed, APK_OPT_SH("I") "installed") \
OPT(OPT_LIST_depends, APK_OPT_SH("d") "depends") \
OPT(OPT_LIST_installed, APK_OPT_SH("I") "installed") \
OPT(OPT_LIST_manifest, "manifest") \
OPT(OPT_LIST_origin, APK_OPT_SH("o") "origin") \
OPT(OPT_LIST_orphaned, APK_OPT_SH("O") "orphaned") \
OPT(OPT_LIST_providers, APK_OPT_SH("P") "providers") \
OPT(OPT_LIST_upgradable, APK_OPT_SH("u") "upgradable") \
OPT(OPT_LIST_manifest, "manifest") \
OPT(OPT_LIST_upgradeable, "upgradeable")
APK_OPT_APPLET(option_desc, LIST_OPTIONS);
@ -203,11 +203,15 @@ static int option_parse_applet(void *pctx, struct apk_ctx *ac, int opt, const ch
ctx->available = 1;
ctx->orphaned = 0;
break;
case OPT_LIST_depends:
ctx->match_depends = 1;
break;
case OPT_LIST_installed:
ctx->installed = 1;
break;
case OPT_LIST_depends:
ctx->match_depends = 1;
case OPT_LIST_manifest:
ctx->manifest = 1;
ctx->installed = 1;
break;
case OPT_LIST_origin:
ctx->match_origin = 1;
@ -219,10 +223,6 @@ static int option_parse_applet(void *pctx, struct apk_ctx *ac, int opt, const ch
case OPT_LIST_providers:
ctx->match_providers = 1;
break;
case OPT_LIST_manifest:
ctx->manifest = 1;
ctx->installed = 1;
break;
case OPT_LIST_upgradable:
case OPT_LIST_upgradeable:
ctx->available = 1;