Skip to content

Conversation

@minhnhdo
Copy link

@minhnhdo minhnhdo commented Dec 2, 2013

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/<package-name>/.

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.

pub fn get_answer() -> int {
    42
}

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

@alexcrichton
Copy link
Member

@mrordinaire, needs a rebase.

@emberian
Copy link
Contributor

@mrordinaire needs another rebase. I also think init should be named to new-workspace or something along those lines, to save rustpkg init for something that actually sets up the recommend project structure (whatever that turns out to be).

@emberian
Copy link
Contributor

Ok, reading the conversation on the other PR, init seems fine.

@minhnhdo minhnhdo closed this Jan 8, 2014
@minhnhdo minhnhdo deleted the rustpkg-init branch January 8, 2014 16:08
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
…=xFrednet

Standard lint formulations

A WIP that fixes rust-lang#10660. Fix lints that don't conform to the standard formulation.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants