aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_help.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-02-08 15:12:28 -0800
committerGitHub <noreply@github.com>2017-02-08 15:12:28 -0800
commit7ddae17e2f520e83d25f78c078bf8b8a58fff447 (patch)
tree87e2fc5c57a685367ec051b1efbdeb5d3ab43f4d /toolsrc/src/commands_help.cpp
parent5e588ddb5be9e6e27cebcc3be2e1a27f3ca83a50 (diff)
parenta9f7fc6e90feaad50c1221ef9bd56e2620302215 (diff)
downloadvcpkg-7ddae17e2f520e83d25f78c078bf8b8a58fff447.tar.gz
vcpkg-7ddae17e2f520e83d25f78c078bf8b8a58fff447.zip
Merge branch 'master' into master
Diffstat (limited to 'toolsrc/src/commands_help.cpp')
-rw-r--r--toolsrc/src/commands_help.cpp87
1 files changed, 60 insertions, 27 deletions
diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp
index 194e809b1..6068c22fb 100644
--- a/toolsrc/src/commands_help.cpp
+++ b/toolsrc/src/commands_help.cpp
@@ -1,20 +1,70 @@
+#include "pch.h"
#include "vcpkg_Commands.h"
-#include "vcpkg.h"
#include "vcpkg_System.h"
-namespace vcpkg
+namespace vcpkg::Commands::Help
{
- void version_command(const vcpkg_cmd_arguments& args)
+ void help_topic_valid_triplet(const vcpkg_paths& paths)
{
- args.check_exact_arg_count(0);
- System::println("Vcpkg package management program version %s\n"
- "\n"
- "See LICENSE.txt for license information.", vcpkg::version()
- );
- exit(EXIT_SUCCESS);
+ System::println("Available architecture triplets:");
+ auto it = fs::directory_iterator(paths.triplets);
+ for (; it != fs::directory_iterator(); ++it)
+ {
+ System::println(" %s", it->path().stem().filename().string());
+ }
}
- void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths)
+ void print_usage()
+ {
+ System::println(
+ "Commands:\n"
+ " vcpkg search [pat] Search for packages available to be built\n"
+ " vcpkg install <pkg> Install a package\n"
+ " vcpkg remove <pkg> Uninstall a package. \n"
+ " vcpkg remove --purge <pkg> Uninstall and delete a package. \n"
+ " vcpkg list List installed packages\n"
+ " vcpkg update Display list of packages for updating\n"
+ " vcpkg hash <file> [alg] Hash a file by specific algorithm, default SHA512\n"
+ "\n"
+ "%s" // Integration help
+ "\n"
+ " vcpkg edit <pkg> Open up a port for editing (uses %%EDITOR%%, default 'code')\n"
+ " vcpkg import <pkg> Import a pre-built library\n"
+ " vcpkg create <pkg> <url>\n"
+ " [archivename] Create a new package\n"
+ " vcpkg owns <pat> Search for files in installed packages\n"
+ " vcpkg cache List cached compiled packages\n"
+ " vcpkg version Display version information\n"
+ " vcpkg contact Display contact information to send feedback\n"
+ "\n"
+ //"internal commands:\n"
+ //" --check-build-deps <controlfile>\n"
+ //" --create-binary-control <controlfile>\n"
+ //"\n"
+ "Options:\n"
+ " --triplet <t> Specify the target architecture triplet.\n"
+ " (default: %%VCPKG_DEFAULT_TRIPLET%%, see 'vcpkg help triplet')\n"
+ "\n"
+ " --vcpkg-root <path> Specify the vcpkg root directory\n"
+ " (default: %%VCPKG_ROOT%%)\n"
+ "\n"
+ "For more help (including examples) see the accompanying README.md."
+ , Integrate::INTEGRATE_COMMAND_HELPSTRING);
+ }
+
+ std::string create_example_string(const std::string& command_and_arguments)
+ {
+ std::string cs = Strings::format("Example:\n"
+ " vcpkg %s", command_and_arguments);
+ return cs;
+ }
+
+ void print_example(const std::string& command_and_arguments)
+ {
+ System::println(create_example_string(command_and_arguments));
+ }
+
+ void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths)
{
args.check_max_arg_count(1);
if (args.command_arguments.empty())
@@ -35,21 +85,4 @@ namespace vcpkg
}
exit(EXIT_SUCCESS);
}
-
- void contact_command(const vcpkg_cmd_arguments& args)
- {
- args.check_exact_arg_count(0);
- System::println("Send an email to vcpkg@microsoft.com with any feedback.");
- exit(EXIT_SUCCESS);
- }
-
- void help_topic_valid_triplet(const vcpkg_paths& paths)
- {
- System::println("Available architecture triplets:");
- auto it = fs::directory_iterator(paths.triplets);
- for (; it != fs::directory_iterator(); ++it)
- {
- System::println(" %s", it->path().stem().filename().string());
- }
- }
}