aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bdep/new.cli8
-rw-r--r--bdep/new.cxx3
2 files changed, 9 insertions, 2 deletions
diff --git a/bdep/new.cli b/bdep/new.cli
index faad002..c46f57d 100644
--- a/bdep/new.cli
+++ b/bdep/new.cli
@@ -37,7 +37,7 @@ namespace bdep
The \cb{new} command creates and initializes a new \cb{build2} project.
All three forms first create according to <spec> a new \cb{build2}
project called <name> in the <name> subdirectory of the current working
- directory.
+ directory (unless overriden with \c{\b{--directory}|\b{-d}}).
The first form then, unless the \cb{--no-init} option is specified,
initializes an empty project database as if by executing the
@@ -203,5 +203,11 @@ namespace bdep
\cb{git} (default) and \cb{none}. Valid values for <opt> are
system-specific."
}
+
+ dir_path --directory|-d
+ {
+ "<dir>",
+ "Create the project in the specified directory."
+ }
};
}
diff --git a/bdep/new.cxx b/bdep/new.cxx
index ce6d1ca..7589dca 100644
--- a/bdep/new.cxx
+++ b/bdep/new.cxx
@@ -97,8 +97,9 @@ namespace bdep
else
s = n;
- dir_path prj (n);
+ dir_path prj (o.directory_specified () ? o.directory () : dir_path (n));
prj.complete ();
+ prj.normalize ();
// If the directory already exists, make sure it is empty. Otherwise
// create it.