aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolsrc/include/vcpkg_Commands.h1
-rw-r--r--toolsrc/src/commands_other.cpp9
2 files changed, 8 insertions, 2 deletions
diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h
index c706c131c..c3da552f2 100644
--- a/toolsrc/include/vcpkg_Commands.h
+++ b/toolsrc/include/vcpkg_Commands.h
@@ -9,6 +9,7 @@ namespace vcpkg
void print_usage();
void print_example(const char* command_and_arguments);
+ std::string create_example_string(const char* command_and_arguments);
void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet);
diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp
index f4fad6690..63f7c52b2 100644
--- a/toolsrc/src/commands_other.cpp
+++ b/toolsrc/src/commands_other.cpp
@@ -41,10 +41,15 @@ namespace vcpkg
, INTEGRATE_COMMAND_HELPSTRING);
}
+ std::string create_example_string(const char* command_and_arguments)
+ {
+ return Strings::format("Example:\n"
+ " vcpkg %s", command_and_arguments);
+ }
+
void print_example(const char* command_and_arguments)
{
- System::println("Example:\n"
- " vcpkg %s", command_and_arguments);
+ System::println(create_example_string(command_and_arguments).c_str());
}
void internal_test_command(const vcpkg_cmd_arguments& /*args*/, const vcpkg_paths& /*paths*/)