fn test(&self);
fn uninstall(&self, _id: &str, _vers: Option<~str>);
fn unprefer(&self, _id: &str, _vers: Option<~str>);
+ fn init(&self);
}
impl CtxMethods for BuildContext {
"test" => {
self.test();
}
+ "init" => {
+ if args.len() != 0 {
+ return usage::init();
+ } else {
+ self.init();
+ }
+ }
"uninstall" => {
if args.len() < 1 {
return usage::uninstall();
fail!("test not yet implemented");
}
+ fn init(&self) {
+ os::mkdir_recursive(&Path("src"), U_RWX);
+ os::mkdir_recursive(&Path("lib"), U_RWX);
+ os::mkdir_recursive(&Path("bin"), U_RWX);
+ os::mkdir_recursive(&Path("build"), U_RWX);
+ }
+
fn uninstall(&self, _id: &str, _vers: Option<~str>) {
fail!("uninstall not yet implemented");
}
~"list" => usage::list(),
~"prefer" => usage::prefer(),
~"test" => usage::test(),
+ ~"init" => usage::init(),
~"uninstall" => usage::uninstall(),
~"unprefer" => usage::unprefer(),
_ => usage::general()
// you could update the match in rustpkg.rc but forget to update this list. I think
// that should be fixed.
static COMMANDS: &'static [&'static str] =
- &["build", "clean", "do", "info", "install", "list", "prefer", "test", "uninstall",
+ &["build", "clean", "do", "info", "init", "install", "list", "prefer", "test", "uninstall",
"unprefer"];