Skip to content

more useful rustpkg init #10760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

more useful rustpkg init #10760

wants to merge 1 commit into from

Conversation

minhnhdo
Copy link
Contributor

@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
Member

@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
Member

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