From 4f80532991f5b9d4d1eae455a91f289e9bea081a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Sep 2016 00:06:37 -0700 Subject: Place owns_command() in a separate cpp file --- toolsrc/src/commands_other.cpp | 16 ---------------- toolsrc/src/commands_owns.cpp | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 toolsrc/src/commands_owns.cpp (limited to 'toolsrc/src') diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp index 2cafd5453..0c56e0f79 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_other.cpp @@ -73,22 +73,6 @@ namespace vcpkg exit(EXIT_SUCCESS); } - void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) - { - args.check_max_args(1); - if (args.command_arguments.size() == 0) - { - System::println(System::color::error, "Error: owns requires a pattern to search for as the first argument."); - std::cout << - "example:\n" - " vcpkg owns .dll\n"; - exit(EXIT_FAILURE); - } - StatusParagraphs status_db = database_load_check(paths); - search_file(paths, args.command_arguments[0], status_db); - exit(EXIT_SUCCESS); - } - void internal_test_command(const vcpkg_cmd_arguments& /*args*/, const vcpkg_paths& /*paths*/) { // auto data = FormatEventData("test"); diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp new file mode 100644 index 000000000..1c54b35f7 --- /dev/null +++ b/toolsrc/src/commands_owns.cpp @@ -0,0 +1,23 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg.h" +#include + +namespace vcpkg +{ + void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + { + args.check_max_args(1); + if (args.command_arguments.size() == 0) + { + System::println(System::color::error, "Error: owns requires a pattern to search for as the first argument."); + std::cout << + "example:\n" + " vcpkg owns .dll\n"; + exit(EXIT_FAILURE); + } + StatusParagraphs status_db = database_load_check(paths); + search_file(paths, args.command_arguments[0], status_db); + exit(EXIT_SUCCESS); + } +} -- cgit v1.2.3