Skip to content

Commit

Permalink
prepare 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gensmusic committed Oct 10, 2020
1 parent a5ebe36 commit aca7cf7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-bin"
version = "0.2.1-alpha"
version = "0.3.0"
authors = ["gensmusic <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,32 @@ cargo install cargo-bin

# usage

## create a new binary main file and add into Cargo.toml

Create a new binary `abc` and add into Cargo.toml.
The following will create a file abc.rs with a default `fn main()` in current folder.
And a `[[bin]]` will be added into the Cargo.toml.

```shell script
cd src
cargo bin new abc
# or
cargo bin new abc.rs
```

The Cargo.toml file.

```toml
[[bin]]
name = "abc"
path = "src/abc.rs"
```

## tidy

`cargo bin tidy` will add all `.rs` file with a `main` function into Cargo.toml.
It will also clean up all the invalid `[[bin]]`s which doesn't exists.

```shell script
# Create a new binary bin1 and add into Cargo.toml
# The following will create a file bin1.rs with a default main in current folder.
# And a [[bin]] will be added into the Cargo.toml
cargo bin new bin1 # or cargo bin new bin1.rs
cargo bin tidy
```

0 comments on commit aca7cf7

Please sign in to comment.