diff options
| author | atkawa7 <atkawa7@yahoo.com> | 2017-06-14 08:29:12 -0700 |
|---|---|---|
| committer | atkawa7 <atkawa7@yahoo.com> | 2017-06-14 08:29:12 -0700 |
| commit | ce5ad1ffe1ed0c6351a09b01bc92a2ad258b8f19 (patch) | |
| tree | b64edb2fe7d020661b3fe30213eef2a967a60fd3 /toolsrc/src/commands_list.cpp | |
| parent | 0a7fee0e8b0a637c83b9dd55bcb7a85c85779aba (diff) | |
| parent | c5ac9898999b712b7bac2fbc497825882d5e9011 (diff) | |
| download | vcpkg-ce5ad1ffe1ed0c6351a09b01bc92a2ad258b8f19.tar.gz vcpkg-ce5ad1ffe1ed0c6351a09b01bc92a2ad258b8f19.zip | |
Merge https://github.com/Microsoft/vcpkg
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()); } } |
