aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:43:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:43:30 +0200
commit817ba792154689df004dbfff67d9ae54cc15584e (patch)
tree065cfd99acbe2c0772803f8f639f9d1f413fbc27
parentc927b2f2a9bcd8d2551759516725917b29903a28 (diff)
Add pkg-install|install and pkg-uninstall|uninstall commands
-rw-r--r--bpkg/bpkg-options.cli54
-rw-r--r--bpkg/bpkg.cxx28
-rw-r--r--bpkg/buildfile17
-rw-r--r--bpkg/common-options.cli6
-rw-r--r--bpkg/pkg-clean-options.cli2
-rw-r--r--bpkg/pkg-install22
-rw-r--r--bpkg/pkg-install-options.cli36
-rw-r--r--bpkg/pkg-uninstall22
-rw-r--r--bpkg/pkg-uninstall-options.cli31
-rw-r--r--bpkg/pkg-update-options.cli2
10 files changed, 164 insertions, 56 deletions
diff --git a/bpkg/bpkg-options.cli b/bpkg/bpkg-options.cli
index 8cd4f9c..4b10268 100644
--- a/bpkg/bpkg-options.cli
+++ b/bpkg/bpkg-options.cli
@@ -55,44 +55,42 @@ namespace bpkg
bool cfg-fetch|fetch
{
- "",
- "Fetch list of available packages.",
- ""
+ "Fetch list of available packages."
}
bool pkg-status|status
{
- "<pkg>",
- "Print package status.",
- ""
+ "Print package status."
}
bool pkg-build|build
{
- "<pkg>",
- "Build package(s) \- \l{bpkg-pkg-build(1)}.",
- ""
+ "Build package \- \l{bpkg-pkg-build(1)}."
}
bool pkg-drop|drop
{
- "<pkg>",
- "Drop package(s).",
- ""
+ "Drop package."
+ }
+
+ bool pkg-install|install
+ {
+ "Install package."
+ }
+
+ bool pkg-uninstall|uninstall
+ {
+ "Uninstall package."
}
bool pkg-update|update
{
- "<pkg>",
- "Update package.",
- ""
+ "Update package."
}
bool pkg-clean|clean
{
- "<pkg>",
- "Clean package.",
- ""
+ "Clean package."
}
bool pkg-verify
@@ -111,37 +109,27 @@ namespace bpkg
bool pkg-unpack
{
- "<pkg>",
- "Unpack package archive.",
- ""
+ "Unpack package archive."
}
bool pkg-configure
{
- "<pkg>",
- "Configure package.",
- ""
+ "Configure package."
}
bool pkg-disfigure
{
- "<pkg>",
- "Disfigure package.",
- ""
+ "Disfigure package."
}
bool pkg-purge
{
- "<pkg>",
- "Purge package.",
- ""
+ "Purge package."
}
bool rep-info
{
- "<rep>",
- "Print information about repository.",
- ""
+ "Print information about repository."
}
bool rep-create
diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx
index 6b2ef85..dc428ed 100644
--- a/bpkg/bpkg.cxx
+++ b/bpkg/bpkg.cxx
@@ -17,16 +17,18 @@
#include <bpkg/help>
#include <bpkg/pkg-build>
+#include <bpkg/pkg-clean>
+#include <bpkg/pkg-configure>
+#include <bpkg/pkg-disfigure>
#include <bpkg/pkg-drop>
-#include <bpkg/pkg-verify>
-#include <bpkg/pkg-status>
#include <bpkg/pkg-fetch>
-#include <bpkg/pkg-unpack>
+#include <bpkg/pkg-install>
#include <bpkg/pkg-purge>
-#include <bpkg/pkg-configure>
-#include <bpkg/pkg-disfigure>
+#include <bpkg/pkg-status>
+#include <bpkg/pkg-uninstall>
+#include <bpkg/pkg-unpack>
#include <bpkg/pkg-update>
-#include <bpkg/pkg-clean>
+#include <bpkg/pkg-verify>
#include <bpkg/cfg-add>
#include <bpkg/cfg-create>
@@ -176,16 +178,18 @@ try
#define PKG_COMMAND(CMD) COMMAND_IMPL(pkg_, "pkg-", CMD)
PKG_COMMAND (build);
+ PKG_COMMAND (clean);
+ PKG_COMMAND (configure);
+ PKG_COMMAND (disfigure);
PKG_COMMAND (drop);
- PKG_COMMAND (verify);
- PKG_COMMAND (status);
PKG_COMMAND (fetch);
- PKG_COMMAND (unpack);
+ PKG_COMMAND (install);
PKG_COMMAND (purge);
- PKG_COMMAND (configure);
- PKG_COMMAND (disfigure);
+ PKG_COMMAND (status);
+ PKG_COMMAND (uninstall);
+ PKG_COMMAND (unpack);
PKG_COMMAND (update);
- PKG_COMMAND (clean);
+ PKG_COMMAND (verify);
// cfg-* commands
//
diff --git a/bpkg/buildfile b/bpkg/buildfile
index 580f303..c117e21 100644
--- a/bpkg/buildfile
+++ b/bpkg/buildfile
@@ -30,8 +30,10 @@ exe{bpkg}: \
{hxx cxx}{ pkg-configure } {hxx ixx cxx}{ pkg-configure-options } \
{hxx cxx}{ pkg-disfigure } {hxx ixx cxx}{ pkg-disfigure-options } \
{hxx cxx}{ pkg-fetch } {hxx ixx cxx}{ pkg-fetch-options } \
+{hxx }{ pkg-install } {hxx ixx cxx}{ pkg-install-options } \
{hxx cxx}{ pkg-purge } {hxx ixx cxx}{ pkg-purge-options } \
{hxx cxx}{ pkg-status } {hxx ixx cxx}{ pkg-status-options } \
+{hxx }{ pkg-uninstall } {hxx ixx cxx}{ pkg-uninstall-options } \
{hxx cxx}{ pkg-unpack } {hxx ixx cxx}{ pkg-unpack-options } \
{hxx }{ pkg-update } {hxx ixx cxx}{ pkg-update-options } \
{hxx cxx}{ pkg-verify } {hxx ixx cxx}{ pkg-verify-options } \
@@ -68,16 +70,19 @@ if! $cli.loaded
# pkg-* command.
#
+
{hxx ixx cxx}{pkg-build-options}: cli{pkg-build-options}
+{hxx ixx cxx}{pkg-clean-options}: cli{pkg-clean-options}
+{hxx ixx cxx}{pkg-configure-options}: cli{pkg-configure-options}
+{hxx ixx cxx}{pkg-disfigure-options}: cli{pkg-disfigure-options}
{hxx ixx cxx}{pkg-drop-options}: cli{pkg-drop-options}
-{hxx ixx cxx}{pkg-status-options}: cli{pkg-status-options}
{hxx ixx cxx}{pkg-fetch-options}: cli{pkg-fetch-options}
-{hxx ixx cxx}{pkg-unpack-options}: cli{pkg-unpack-options}
+{hxx ixx cxx}{pkg-install-options}: cli{pkg-install-options}
{hxx ixx cxx}{pkg-purge-options}: cli{pkg-purge-options}
-{hxx ixx cxx}{pkg-configure-options}: cli{pkg-configure-options}
-{hxx ixx cxx}{pkg-disfigure-options}: cli{pkg-disfigure-options}
+{hxx ixx cxx}{pkg-status-options}: cli{pkg-status-options}
+{hxx ixx cxx}{pkg-uninstall-options}: cli{pkg-uninstall-options}
+{hxx ixx cxx}{pkg-unpack-options}: cli{pkg-unpack-options}
{hxx ixx cxx}{pkg-update-options}: cli{pkg-update-options}
-{hxx ixx cxx}{pkg-clean-options}: cli{pkg-clean-options}
{hxx ixx cxx}{pkg-verify-options}: cli{pkg-verify-options}
# cfg-* command.
@@ -97,7 +102,7 @@ cli.options += -I $src_root --include-with-brackets --include-prefix bpkg \
--guard-prefix BPKG --cxx-prologue "#include <bpkg/types-parsers>" \
--cli-namespace bpkg::cli --generate-file-scanner --generate-specifier \
--generate-parse --ansi-color --page-usage 'bpkg::print_$name$_' \
---include-base-last --long-usage --option-length 22
+--include-base-last --long-usage --option-length 23
cli.cxx{common-options}: cli.options += --short-usage # Both short and long.
cli.cxx{bpkg-options}: cli.options += --suppress-undocumented # --help, etc.
diff --git a/bpkg/common-options.cli b/bpkg/common-options.cli
index 86955d7..c68e588 100644
--- a/bpkg/common-options.cli
+++ b/bpkg/common-options.cli
@@ -136,9 +136,9 @@ namespace bpkg
string --pager // String to allow empty value.
{
"<path>",
- "The pager program to be used to show text, such as help. Commonly
- used pager programs are \cb{less} and \cb{more}. You can also specify
- additional options that should be passed to the pager program with
+ "The pager program to be used to show long text. Commonly used pager
+ programs are \cb{less} and \cb{more}. You can also specify additional
+ options that should be passed to the pager program with
\cb{--pager-option}. If an empty string is specified as the pager
program, then no pager will be used. If the pager program is not
explicitly specified, then \cb{bpkg} will try to use \cb{less}. If it
diff --git a/bpkg/pkg-clean-options.cli b/bpkg/pkg-clean-options.cli
index e790db6..007e5f8 100644
--- a/bpkg/pkg-clean-options.cli
+++ b/bpkg/pkg-clean-options.cli
@@ -11,7 +11,7 @@ include <bpkg/configuration-options.cli>;
/*
"\h{SYNOPSIS}
-bpkg pkg-clean <pkg>"
+bpkg pkg-clean <pkg>..."
"\h{DESCRIPTION}
diff --git a/bpkg/pkg-install b/bpkg/pkg-install
new file mode 100644
index 0000000..501e76e
--- /dev/null
+++ b/bpkg/pkg-install
@@ -0,0 +1,22 @@
+// file : bpkg/pkg-install -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BPKG_PKG_INSTALL
+#define BPKG_PKG_INSTALL
+
+#include <bpkg/types>
+#include <bpkg/forward> // selected_package
+#include <bpkg/pkg-command>
+#include <bpkg/pkg-install-options>
+
+namespace bpkg
+{
+ inline int
+ pkg_install (const pkg_install_options& o, cli::scanner& args)
+ {
+ return pkg_command ("install", o, args);
+ }
+}
+
+#endif // BPKG_PKG_INSTALL
diff --git a/bpkg/pkg-install-options.cli b/bpkg/pkg-install-options.cli
new file mode 100644
index 0000000..32d3cf7
--- /dev/null
+++ b/bpkg/pkg-install-options.cli
@@ -0,0 +1,36 @@
+// file : bpkg/pkg-install-options.cli
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+include <bpkg/configuration-options.cli>;
+
+"\section=1"
+"\name=bpkg-pkg-install"
+"\summary=install package"
+
+namespace bpkg
+{
+ {
+ "<options> <pkg>",
+
+ "\h|SYNOPSIS|
+
+ \c{\b{bpkg pkg-install} [<options>] <pkg>...}
+
+ \h|DESCRIPTION|
+
+ The \cb{pkg-install} command installs one or more packages. Underneath,
+ this command doesn't do much more than run \cb{b install}. The
+ installation directory can be specified when creating the configuration
+ (\l{bpkg-cfg-create(1)}) with the \cb{config.install.root} configuration
+ variable."
+
+ // @@ Would be nice to be able to specify the root it in the command.
+ // Probably an option to specify additional configuration vars.
+ }
+
+ class pkg_install_options: configuration_options
+ {
+ "\h|PKG-INSTALL OPTIONS|"
+ };
+}
diff --git a/bpkg/pkg-uninstall b/bpkg/pkg-uninstall
new file mode 100644
index 0000000..57f83ab
--- /dev/null
+++ b/bpkg/pkg-uninstall
@@ -0,0 +1,22 @@
+// file : bpkg/pkg-uninstall -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BPKG_PKG_UNINSTALL
+#define BPKG_PKG_UNINSTALL
+
+#include <bpkg/types>
+#include <bpkg/forward> // selected_package
+#include <bpkg/pkg-command>
+#include <bpkg/pkg-uninstall-options>
+
+namespace bpkg
+{
+ inline int
+ pkg_uninstall (const pkg_uninstall_options& o, cli::scanner& args)
+ {
+ return pkg_command ("uninstall", o, args);
+ }
+}
+
+#endif // BPKG_PKG_UNINSTALL
diff --git a/bpkg/pkg-uninstall-options.cli b/bpkg/pkg-uninstall-options.cli
new file mode 100644
index 0000000..eff025c
--- /dev/null
+++ b/bpkg/pkg-uninstall-options.cli
@@ -0,0 +1,31 @@
+// file : bpkg/pkg-uninstall-options.cli
+// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+include <bpkg/configuration-options.cli>;
+
+"\section=1"
+"\name=bpkg-pkg-uninstall"
+"\summary=uninstall package"
+
+namespace bpkg
+{
+ {
+ "<options> <pkg>",
+
+ "\h|SYNOPSIS|
+
+ \c{\b{bpkg pkg-uninstall} [<options>] <pkg>...}
+
+ \h|DESCRIPTION|
+
+ The \cb{pkg-uninstall} command uninstalls one or more packages that were
+ previously installed with \l{bpkg-cfg-install(1)}. Underneath, this
+ command doesn't do much more than run \cb{b uninstall}."
+ }
+
+ class pkg_uninstall_options: configuration_options
+ {
+ "\h|PKG-UNINSTALL OPTIONS|"
+ };
+}
diff --git a/bpkg/pkg-update-options.cli b/bpkg/pkg-update-options.cli
index a395041..0879174 100644
--- a/bpkg/pkg-update-options.cli
+++ b/bpkg/pkg-update-options.cli
@@ -11,7 +11,7 @@ include <bpkg/configuration-options.cli>;
/*
"\h{SYNOPSIS}
-bpkg pkg-update <pkg>"
+bpkg pkg-update <pkg>..."
"\h{DESCRIPTION}