diff options
| author | atkawa7 <atkawa7@yahoo.com> | 2017-06-13 17:12:54 -0700 |
|---|---|---|
| committer | atkawa7 <atkawa7@yahoo.com> | 2017-06-13 17:12:54 -0700 |
| commit | aa83671a723da212e640990ef9b9efafccba8af1 (patch) | |
| tree | f50d482f3d2b4e3545a672eb58712ac553d272de /toolsrc/src/commands_list.cpp | |
| parent | 9a409006cf7ec63bebe0d9341799b5cb529155ae (diff) | |
| parent | 548ff8d3db47e83ebecc5b57dcbd63723cee7546 (diff) | |
| download | vcpkg-aa83671a723da212e640990ef9b9efafccba8af1.tar.gz vcpkg-aa83671a723da212e640990ef9b9efafccba8af1.zip | |
Merge https://github.com/Microsoft/vcpkg into live555
Diffstat (limited to 'toolsrc/src/commands_list.cpp')
| -rw-r--r-- | toolsrc/src/commands_list.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 6451ac5eb..d21883fc2 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -7,12 +7,21 @@ namespace vcpkg::Commands::List { - static void do_print(const StatusParagraph& pgh) + static const std::string OPTION_FULLDESC = "--x-full-desc"; // TODO: This should find a better home, eventually + + static void do_print(const StatusParagraph& pgh, bool FullDesc) { - System::println("%-27s %-16s %s", - pgh.package.displayname(), - pgh.package.version, - details::shorten_description(pgh.package.description)); + if (FullDesc) + { + System::println("%-27s %-16s %s", pgh.package.displayname(), pgh.package.version, pgh.package.description); + } + else + { + System::println("%-27s %-16s %s", + pgh.package.displayname(), + pgh.package.version, + details::shorten_description(pgh.package.description)); + } } void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) @@ -21,7 +30,8 @@ namespace vcpkg::Commands::List "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Help::create_example_string("list png")); args.check_max_arg_count(1, example); - args.check_and_get_optional_command_arguments({}); + const std::unordered_set<std::string> options = + args.check_and_get_optional_command_arguments({OPTION_FULLDESC}); const StatusParagraphs status_paragraphs = database_load_check(paths); std::vector<StatusParagraph*> installed_packages = get_installed_ports(status_paragraphs); @@ -42,7 +52,7 @@ namespace vcpkg::Commands::List { for (const StatusParagraph* status_paragraph : installed_packages) { - do_print(*status_paragraph); + do_print(*status_paragraph, options.find(OPTION_FULLDESC) != options.cend()); } } else @@ -56,7 +66,7 @@ namespace vcpkg::Commands::List continue; } - do_print(*status_paragraph); + do_print(*status_paragraph, options.find(OPTION_FULLDESC) != options.cend()); } } |
