From: Vitek Karas Date: Wed, 2 Jan 2019 20:21:39 +0000 (-0800) Subject: Fix usage message for `--roll-forward-on-no-candidate-fx` (dotnet/core-setup#4878) X-Git-Tag: submit/tizen/20210909.063632~11032^2~438 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa5a0057e856ff02f4345e5a4464d29140e642e7;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix usage message for `--roll-forward-on-no-candidate-fx` (dotnet/core-setup#4878) Fix usage message for roll-forward-on-no-candidate-fx to make it clear that it requires a value. Made the descriptions consistent with those reported by CLI (dots at the end). In case of parsing error, show the argument descriptions as well, not just the names and values. Commit migrated from https://github.com/dotnet/core-setup/commit/c2c71ca8a4534ecc53dcd8bb1ece1bc2e1af8f97 --- diff --git a/src/installer/corehost/cli/fxr/fx_muxer.cpp b/src/installer/corehost/cli/fxr/fx_muxer.cpp index 44df04f..23b114e 100644 --- a/src/installer/corehost/cli/fxr/fx_muxer.cpp +++ b/src/installer/corehost/cli/fxr/fx_muxer.cpp @@ -638,10 +638,10 @@ void fx_muxer_t::muxer_usage(bool is_sdk_present) for (const auto& arg : known_opts) { - trace::println(_X(" %-34s %s"), (arg.option + _X(" ") + arg.argument).c_str(), arg.description.c_str()); + trace::println(_X(" %-37s %s"), (arg.option + _X(" ") + arg.argument).c_str(), arg.description.c_str()); } - trace::println(_X(" --list-runtimes Display the installed runtimes")); - trace::println(_X(" --list-sdks Display the installed SDKs")); + trace::println(_X(" --list-runtimes Display the installed runtimes")); + trace::println(_X(" --list-sdks Display the installed SDKs")); if (!is_sdk_present) { @@ -698,19 +698,19 @@ void append_probe_realpath(const pal::string_t& path, std::vector std::vector fx_muxer_t::get_known_opts(bool exec_mode, host_mode_t mode, bool get_all_options) { - std::vector known_opts = { { _X("--additionalprobingpath"), _X(""), _X("Path containing probing policy and assemblies to probe for") } }; + std::vector known_opts = { { _X("--additionalprobingpath"), _X(""), _X("Path containing probing policy and assemblies to probe for.") } }; if (get_all_options || exec_mode || mode == host_mode_t::split_fx || mode == host_mode_t::apphost) { - known_opts.push_back({ _X("--depsfile"), _X(""), _X("Path to .deps.json file")}); - known_opts.push_back({ _X("--runtimeconfig"), _X(""), _X("Path to .runtimeconfig.json file")}); + known_opts.push_back({ _X("--depsfile"), _X(""), _X("Path to .deps.json file.")}); + known_opts.push_back({ _X("--runtimeconfig"), _X(""), _X("Path to .runtimeconfig.json file.")}); } if (get_all_options || mode == host_mode_t::muxer || mode == host_mode_t::apphost) { // If mode=host_mode_t::apphost, these are only used when the app is framework-dependent. known_opts.push_back({ _X("--fx-version"), _X(""), _X("Version of the installed Shared Framework to use to run the application.")}); - known_opts.push_back({ _X("--roll-forward-on-no-candidate-fx"), _X(""), _X("Roll forward on no candidate shared framework is enabled")}); - known_opts.push_back({ _X("--additional-deps"), _X(""), _X("Path to additonal deps.json file")}); + known_opts.push_back({ _X("--roll-forward-on-no-candidate-fx"), _X(""), _X("Roll forward on no candidate framework (0=off, 1=roll minor, 2=roll major & minor).")}); + known_opts.push_back({ _X("--additional-deps"), _X(""), _X("Path to additional deps.json file.")}); } return known_opts; @@ -737,7 +737,7 @@ int fx_muxer_t::parse_args( trace::error(_X("Failed to parse supported options or their values:")); for (const auto& arg : known_opts) { - trace::error(_X(" %s"), (arg.option + _X(" ") + arg.argument).c_str()); + trace::error(_X(" %-37s %s"), (arg.option + _X(" ") + arg.argument).c_str(), arg.description.c_str()); } return InvalidArgFailure; }