From 0e4d06919b7c075275b22edfc031f90b7f421e7a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Sep 2015 14:24:15 +0200 Subject: Implement rep-create (create repository) command --- bpkg/bpkg.cxx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'bpkg/bpkg.cxx') diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index 849a386..176cc97 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -11,11 +11,10 @@ #include +// Commands. +// #include -#include - -//#include -#include +#include using namespace std; using namespace bpkg; @@ -111,10 +110,16 @@ try // If not, then it got to be a help topic. // if (cmd_argc != 1) - return help (ho, cmd_argv[1], nullptr); + { + help (ho, cmd_argv[1], nullptr); + return 0; + } } else - return help (ho, "", nullptr); + { + help (ho, "", nullptr); + return 0; + } } // Handle commands. @@ -125,7 +130,8 @@ try if (cmd.help ()) { assert (h); - return help (ho, "help", help_options::print_usage); + help (ho, "help", help_options::print_usage); + return 0; } // rep-create @@ -133,16 +139,15 @@ try if (cmd.rep_create ()) { if (h) - return help (ho, "rep-create", rep_create_options::print_usage); - - auto o (parse (co, args)); - - if (verb) - text << "rep-create"; + help (ho, "rep-create", rep_create_options::print_usage); + else + rep_create (parse (co, args), args); return 0; } + // @@ Would be nice to check that args doesn't contain any junk left. + assert (false); // Unhandled command. return 1; } -- cgit v1.1