aboutsummaryrefslogtreecommitdiff
path: root/bpkg/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-02 17:09:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-02 17:09:57 +0200
commit94c3574492b6db6ae8d5fbef717f8e6f92f1d402 (patch)
treed5cee1ec9d601fbf9da02f82b9ca8431880aea0b /bpkg/buildfile
parent317cf86dedbd72aacc673c6257cc178e76ee77e3 (diff)
Command line options/commands/help infrastructure
Diffstat (limited to 'bpkg/buildfile')
-rw-r--r--bpkg/buildfile24
1 files changed, 23 insertions, 1 deletions
diff --git a/bpkg/buildfile b/bpkg/buildfile
index 8437c86..4b1a258 100644
--- a/bpkg/buildfile
+++ b/bpkg/buildfile
@@ -2,7 +2,29 @@
# copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
+using cli
+
import libs = libbutl%lib{butl}
import libs += libbpkg%lib{bpkg}
-exe{bpkg}: cxx{bpkg diagnostics} $libs
+exe{bpkg}: cxx{diagnostics} cli.cxx{common-options} \
+ cxx{bpkg} cli.cxx{bpkg-options} \
+ cxx{help} cli.cxx{help-options} \
+ cli.cxx{rep-create-options} \
+ $libs
+
+cli.options += -I $src_root --include-with-brackets --include-prefix bpkg \
+--guard-prefix BPKG --generate-file-scanner --cli-namespace bpkg::cli \
+--generate-parse --long-usage --exclude-base
+
+# Option length must be the same to get commands/topics/options lists
+# aligned in the general help.
+#
+cli.cxx{common-options}: cli{common-options}
+cli.cxx{common-options}: cli.options += --option-length 22 --short-usage
+
+cli.cxx{bpkg-options}: cli{bpkg-options}
+cli.cxx{bpkg-options}: cli.options += --option-length 22 --short-usage
+
+cli.cxx{help-options}: cli{help-options}
+cli.cxx{rep-create-options}: cli{rep-create-options}