From 8e1ed2c9a95fa5b9e0bb0a9849a6e20878696f8c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:41:50 -0800 Subject: Place contact and version commands in different cpp files --- toolsrc/src/commands_version.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 toolsrc/src/commands_version.cpp (limited to 'toolsrc/src/commands_version.cpp') diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp new file mode 100644 index 000000000..03cce32d4 --- /dev/null +++ b/toolsrc/src/commands_version.cpp @@ -0,0 +1,16 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg_info.h" + +namespace vcpkg::Commands +{ + void version_command(const vcpkg_cmd_arguments& args) + { + args.check_exact_arg_count(0); + System::println("Vcpkg package management program version %s\n" + "\n" + "See LICENSE.txt for license information.", Info::version() + ); + exit(EXIT_SUCCESS); + } +} -- cgit v1.2.3 From cc8851144a871931b93d84bd962364159ad1c424 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 22:03:57 -0800 Subject: Reorganize commands, each in its own namespace Additionally, functions related to a command can now live in the same namespace --- toolsrc/src/commands_version.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/src/commands_version.cpp') diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index 03cce32d4..e98251601 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -2,9 +2,9 @@ #include "vcpkg_System.h" #include "vcpkg_info.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Version { - void version_command(const vcpkg_cmd_arguments& args) + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); System::println("Vcpkg package management program version %s\n" -- cgit v1.2.3