diff --git a/docs/swupd.1.rst b/docs/swupd.1.rst index 2089f01d..6f551064 100644 --- a/docs/swupd.1.rst +++ b/docs/swupd.1.rst @@ -168,7 +168,7 @@ SUBCOMMANDS are available. It will return 0 with succeeded and a different value of 0 with failed. - - `-d, --deps={bundle}` + - `--deps={bundle}` Lists all bundle dependencies of the passed bundle, including recursively included bundles. @@ -281,7 +281,7 @@ SUBCOMMANDS /etc/swupd/mirror_contenturl and /etc/swupd/mirror_versionurl - - `-u, --unset` + - `-U, --unset` Remove the content and version URL configuration by removing /etc/swupd @@ -378,7 +378,7 @@ SUBCOMMANDS Only runs the repair operation on the os-core and vi bundles. -``search {string}`` +``search-file {string}`` Search for matching paths in manifest data. The specified {string} is matched in any part of the path listed in manifests, and all @@ -396,7 +396,7 @@ SUBCOMMANDS Restrict search to designated dynamic shared library paths. - - `-b, --binary` + - `-B, --binary` Restrict search to designated program binary paths. @@ -433,7 +433,7 @@ SUBCOMMANDS available on the version url server, and what version number is available. - - `-d, --download` + - `--download` Do not perform an update, instead download all resources needed to perform the update, and exit. diff --git a/src/clr_bundle_ls.c b/src/clr_bundle_ls.c index 9be1e3c6..33fb2c3a 100644 --- a/src/clr_bundle_ls.c +++ b/src/clr_bundle_ls.c @@ -28,6 +28,8 @@ #include "config.h" #include "swupd.h" +#define DEPS_FLAG 1000 + static bool cmdline_option_all = false; static char *cmdline_option_has_dep = NULL; static char *cmdline_option_deps = NULL; @@ -54,14 +56,14 @@ static void print_help(void) print("Options:\n"); print(" -a, --all List all available bundles for the current version of Clear Linux\n"); - print(" -d, --deps=[BUNDLE] List bundles included by BUNDLE\n"); print(" -D, --has-dep=[BUNDLE] List dependency tree of all bundles which have BUNDLE as a dependency\n"); + print(" --deps=[BUNDLE] List bundles included by BUNDLE\n"); print("\n"); } static const struct option prog_opts[] = { { "all", no_argument, 0, 'a' }, - { "deps", required_argument, 0, 'd' }, + { "deps", required_argument, 0, DEPS_FLAG }, { "has-dep", required_argument, 0, 'D' }, }; @@ -77,7 +79,7 @@ static bool parse_opt(int opt, char *optarg) atexit(free_has_dep); cmdline_local = false; return true; - case 'd': + case DEPS_FLAG: string_or_die(&cmdline_option_deps, "%s", optarg); atexit(free_deps); cmdline_local = false; diff --git a/src/mirror.c b/src/mirror.c index 2a2cf2d5..d663637e 100644 --- a/src/mirror.c +++ b/src/mirror.c @@ -44,13 +44,13 @@ static void print_help(void) print("Options:\n"); print(" -s, --set set mirror url\n"); - print(" -u, --unset unset mirror url\n"); + print(" -U, --unset unset mirror url\n"); print("\n"); } static const struct option prog_opts[] = { { "set", required_argument, 0, 's' }, - { "unset", no_argument, 0, 'u' }, + { "unset", no_argument, 0, 'U' }, }; static bool parse_opt(int opt, char *optarg) @@ -63,7 +63,7 @@ static bool parse_opt(int opt, char *optarg) } set = optarg; return true; - case 'u': + case 'U': if (set != NULL) { error("cannot set and unset at the same time\n"); return false; diff --git a/src/search.c b/src/search.c index 34fc6636..6324e042 100644 --- a/src/search.c +++ b/src/search.c @@ -488,7 +488,7 @@ static void print_help(void) print("Options:\n"); print(" -l, --library Search paths where libraries are located for a match\n"); - print(" -b, --binary Search paths where binaries are located for a match\n"); + print(" -B, --binary Search paths where binaries are located for a match\n"); print(" -T, --top=[NUM] Only display the top NUM results for each bundle\n"); print(" -m, --csv Output all results in CSV format (machine-readable)\n"); print(" -i, --init Download all manifests then return, no search done\n"); @@ -498,7 +498,7 @@ static void print_help(void) } static const struct option prog_opts[] = { - { "binary", no_argument, 0, 'b' }, + { "binary", no_argument, 0, 'B' }, { "csv", no_argument, 0, 'm' }, { "init", no_argument, 0, 'i' }, { "library", no_argument, 0, 'l' }, @@ -538,7 +538,7 @@ static bool parse_opt(int opt, char *optarg) case 'i': init = true; return true; - case 'b': + case 'B': search_type |= SEARCH_TYPE_BIN; return true; default: diff --git a/src/update.c b/src/update.c index 9ffa9c4a..4f441df4 100644 --- a/src/update.c +++ b/src/update.c @@ -38,7 +38,7 @@ #include "swupd.h" static int requested_version = -1; -static bool download_only; +static int download_only = 0; int nonpack; @@ -87,7 +87,7 @@ static int update_loop(struct list *updates, struct manifest *server_manifest) return ret; } - if (download_only) { + if (download_only == 1) { return 0; } @@ -443,7 +443,7 @@ version_check: updates = list_sort(updates, file_sort_filename); ret = update_loop(updates, server_manifest); - if (ret == 0 && !download_only) { + if (ret == 0 && download_only == 0) { /* Failure to write the version file in the state directory * should not affect exit status. */ (void)update_device_latest_version(server_version); @@ -527,7 +527,7 @@ clean_curl: if (nonpack > 0) { info("%i files were not in a pack\n", nonpack); } - if (!download_only) { + if (download_only == 0) { if (current_version < server_version) { print("Update successful. System updated from version %d to version %d\n", current_version, server_version); @@ -572,7 +572,7 @@ clean_curl: static bool cmd_line_status = false; static const struct option prog_opts[] = { - { "download", no_argument, 0, 'd' }, + { "download", no_argument, &download_only, 1 }, { "version", required_argument, 0, 'V' }, { "manifest", required_argument, 0, 'm' }, { "status", no_argument, 0, 's' }, @@ -594,12 +594,12 @@ static void print_help(void) // so it is not visible but the option must remain available in the back so we don't break users print("Options:\n"); print(" -V, --version=V Update to version V, also accepts 'latest' (default)\n"); - print(" -d, --download Download all content, but do not actually install the update\n"); print(" -s, --status Show current OS version and latest version available on server. Equivalent to \"swupd check-update\"\n"); print(" -k, --keepcache Do not delete the swupd state directory content after updating the system\n"); print(" -T, --migrate Migrate to augmented upstream/mix content\n"); print(" -a, --allow-mix-collisions Ignore and continue if custom user content conflicts with upstream provided content\n"); print(" -m, --manifest=V NOTE: this flag has been superseded. Please use -V instead\n"); + print(" --download Download all content, but do not actually install the update\n"); print("\n"); } @@ -624,9 +624,6 @@ static bool parse_opt(int opt, char *optarg) case 'a': allow_mix_collisions = true; return true; - case 'd': - download_only = true; - return true; case 's': cmd_line_status = true; return true;