aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-fetch.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-08 16:56:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-08 16:56:47 +0200
commit5fd147738125c30d6e16803f387af023d1e85588 (patch)
treea8ac1cde30ce8b15ae3b9f65c1c18a92ce4f84a3 /bpkg/pkg-fetch.cxx
parent714a13a117d53d98769d224193a2115aff9ae7ea (diff)
Use <pkg>/<ver> format in all commands
Diffstat (limited to 'bpkg/pkg-fetch.cxx')
-rw-r--r--bpkg/pkg-fetch.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/bpkg/pkg-fetch.cxx b/bpkg/pkg-fetch.cxx
index 14022e8..daa2d5e 100644
--- a/bpkg/pkg-fetch.cxx
+++ b/bpkg/pkg-fetch.cxx
@@ -60,17 +60,17 @@ namespace bpkg
else
{
if (!args.more ())
- fail << "package name argument expected" <<
+ fail << "package name/version argument expected" <<
info << "run 'bpkg help pkg-fetch' for more information";
- string n (args.next ());
+ const char* arg (args.next ());
+ string n (parse_package_name (arg));
+ version v (parse_package_version (arg));
- if (!args.more ())
- fail << "package version argument expected" <<
+ if (v.empty ())
+ fail << "package version expected" <<
info << "run 'bpkg help pkg-fetch' for more information";
- version v (parse_version (args.next ()));
-
if (db.query_value<repository_count> () == 0)
fail << "configuration " << c << " has no repositories" <<
info << "use 'bpkg rep-add' to add a repository";