Skip to content

Commit

Permalink
Swap order of template and profile in apply once again
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Mar 8, 2024
1 parent 64fcbd7 commit 3e3fc37
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ $ cargo install cargo-wizard
```
- Non-interactive mode (directly apply a predefined template to your Cargo workspace):
```bash
$ cargo wizard apply <profile> <template>
$ cargo wizard apply <template> <profile>
# For example, apply `fast-runtime` template to the `dist` profile
$ cargo wizard apply dist fast-runtime
$ cargo wizard apply fast-runtime dist
```

> You can enable profile/config options that require a nightly compiler by running `cargo-wizard` with a nightly Cargo
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! Non-interactive command-line usage:
//! ```bash
//! cargo wizard apply <profile> <template>
//! cargo wizard apply <template> <profile> [--nightly=on]
//! ```
//! Interactive command-line usage:
//! ```bash
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ impl FromStr for ProfileArg {

#[derive(clap::Parser, Debug)]
struct ApplyArgs {
/// Cargo profile that should be created or modified.
profile: ProfileArg,
/// Template that will be applied to the selected Cargo profile.
template: PredefinedTemplateKind,
/// Cargo profile that should be created or modified.
profile: ProfileArg,
}

#[derive(clap::Parser, Debug)]
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ edition = "2021"
project
.cmd(&[
"apply",
"dev",
"fast-compile",
"dev",
"--nightly=off",
"--manifest-path",
manifest_path,
Expand Down Expand Up @@ -60,7 +60,7 @@ members = ["bar"]
);

project
.cmd(&["apply", "dev", "fast-compile", "--nightly=off"])
.cmd(&["apply", "fast-compile", "dev", "--nightly=off"])
.cwd(&project.path("bar"))
.run()?
.assert_ok();
Expand Down Expand Up @@ -269,7 +269,7 @@ fn apply_min_size_template() -> anyhow::Result<()> {

fn apply(project: &CargoProject, profile: &str, template: &str) -> anyhow::Result<()> {
project
.cmd(&["apply", profile, template, "--nightly=off"])
.cmd(&["apply", template, profile, "--nightly=off"])
.run()?
.assert_ok();
Ok(())
Expand Down

0 comments on commit 3e3fc37

Please sign in to comment.