aboutsummaryrefslogtreecommitdiff
path: root/bpkg/bpkg.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-04 14:24:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-04 14:24:15 +0200
commit0e4d06919b7c075275b22edfc031f90b7f421e7a (patch)
tree2aa441c99823561ab8f0c6b2d28a2965b2099514 /bpkg/bpkg.cxx
parent81abf8eab067eab362f180a418215f9408de41dc (diff)
Implement rep-create (create repository) command
Diffstat (limited to 'bpkg/bpkg.cxx')
-rw-r--r--bpkg/bpkg.cxx31
1 files changed, 18 insertions, 13 deletions
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 <bpkg/bpkg-options>
+// Commands.
+//
#include <bpkg/help>
-#include <bpkg/help-options>
-
-//#include <bpkg/rep-create>
-#include <bpkg/rep-create-options>
+#include <bpkg/rep-create>
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<rep_create_options> (co, args));
-
- if (verb)
- text << "rep-create";
+ help (ho, "rep-create", rep_create_options::print_usage);
+ else
+ rep_create (parse<rep_create_options> (co, args), args);
return 0;
}
+ // @@ Would be nice to check that args doesn't contain any junk left.
+
assert (false); // Unhandled command.
return 1;
}