Skip to content

Commit

Permalink
Replace == with = in documentation (#31)
Browse files Browse the repository at this point in the history
* documentation tweak

* Update README.md

* Update README.md

* Update README.md

* Update main.rs

* Update README.md

* Update README.md

Co-authored-by: Yohan Boogaert <yozhgoor@outlook.com>
  • Loading branch information
eopb and yozhgoor authored Jul 27, 2021
1 parent c090263 commit cca91c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ Create a new temporary project:

* With no additional dependencies:
`$ cargo-temp`

* With multiple dependencies:
`$ cargo-temp rand tokio`

* With a dependency that have a fixed version:
`$ cargo-temp anyhow==1.0.13`

* When specifying a version:
`$ cargo-temp anyhow=1.0`
* Using the [cargo's comparison requirements][comparison]:
`$ cargo-temp anyhow==1.0.13`

### Repositories

Expand All @@ -36,15 +38,16 @@ Examples:
* SSH
`$ cargo-temp anyhow=ssh://git@github.com/dtolnay/anyhow.git`

This will add the repository on the default branch by default. You can choose
another branch or a revision:
To choose a branch or a revision:

* Branch
`$ cargo-temp anyhow=https://github.com/dtolnay/anyhow.git#branch=master`

* Revision
`$ cargo-temp anyhow=https://github.com/dtolnay/anyhow.git#rev=7e0f77a38`

Without a branch or a revision, cargo will use the default branch of the repository.

## Features

If you change your mind and decide to keep the project you can just delete the
Expand All @@ -55,8 +58,8 @@ editor exits.

The config file is located at `{CONFIG_DIR}/cargo-temp/config.toml`.
When you run `cargo-temp` for the first time it will be created automatically.
We use the [XDG system](https://docs.rs/xdg/2.2.0/xdg/) for both Linux and OSX
and the [Know Folder system](https://docs.rs/dirs-2/3.0.1/dirs_2/) on Windows.
We use the [XDG system][xdg] for both Linux and OSX
and the [Known Folder system][knownfolder] on Windows.

### Temporary project directory

Expand Down Expand Up @@ -89,3 +92,7 @@ editor_args = [ "--wait", "--new-window" ]
editor = "C:\\Program Files\\Microsoft VS Code\\Code.exe"
editor_args = [ "--wait", "--new-window" ]
```

[comparison]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#comparison-requirements
[xdg]: https://docs.rs/xdg/2.2.0/xdg/
[knownfolder]: https://docs.rs/dirs-2/3.0.1/dirs_2/
10 changes: 1 addition & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct Cli {
/// Dependencies to add to `Cargo.toml`.
///
/// The default version used is `*` but this can be replaced using `=`.
/// E.g. `cargo-temp anyhow==1.0.13`
/// E.g. `cargo-temp anyhow=1.0.13`
#[clap(parse(from_str = parse_dependency))]
dependencies: Vec<Dependency>,

Expand Down Expand Up @@ -270,14 +270,6 @@ mod parse_dependency_tests {
)
}

#[test]
fn dependency_with_minor_version() {
assert_eq!(
parse_dependency("anyhow==1.1.0"),
Dependency::CrateIo("anyhow".to_string(), Some("=1.1.0".to_string()))
)
}

#[test]
fn repository_with_http() {
assert_eq!(
Expand Down

0 comments on commit cca91c2

Please sign in to comment.