mozilla/rust — pull request #10760 by mrordinaire (2013-12-02 01:52:32+00:00)
Title: more useful rustpkg init

This PR modifies the behavior of `rustpkg init`.

`rustpkg init` now accepts two more arguments, the first is the type of package to initialize (`bin` or `lib`), and the second is the package name. Instead of initializing a workspace in the current directory, `rustpkg init` now initializes a workspace under the directory with the same name as the supplied package name. In addition, it also creates some default crates (i.e. `lib.rs` or `main.rs`) under `src//`.

E.g. `rustpkg init lib awesome_lib` will create the following directory tree in the current directory.

awesome_lib/
- bin/
- build/
- lib/
- src/
- awesome_lib/
- lib.rs

The content of `lib.rs` is the following.
```rust
pub fn get_answer() -> int {
42
}
```

EDIT: `test.rs` is no longer generated.
PS: re-opening of #10651, as per request @alexcrichton