yozhgoor / cargo-temp

A CLI tool that allow you to create a temporary new Rust project using cargo with already installed dependencies
MIT License
79 stars 9 forks source link

Name of the temporary crate #5

Closed yozhgoor closed 3 years ago

yozhgoor commented 3 years ago

When i run $ cargo run in the shell of a new project, i have this warning about the snake_case name:

yozhgoor@roswell:~/.cache/cargo-temp/tmp_DxBHSr$ cargo run
   Compiling tmp_DxBHSr v0.1.0 (/home/yozhgoor/.cache/cargo-temp/tmp_DxBHSr)
warning: crate `tmp_DxBHSr` should have a snake case name
  |
  = note: `#[warn(non_snake_case)]` on by default
  = help: convert the identifier to snake case: `tmp_dx_bhsr`

warning: 1 warning emitted
cecton commented 3 years ago
> cargo init --help
cargo-init 
Create a new cargo package in an existing directory

USAGE:
    cargo init [OPTIONS] [--] [path]

OPTIONS:
    -q, --quiet                    No output printed to stdout
        --registry <REGISTRY>      Registry to use
        --vcs <VCS>                Initialize a new repository for the given version control system (git, hg, pijul, or
                                   fossil) or do not initialize any version control at all (none), overriding a global
                                   configuration. [possible values: git, hg, pijul, fossil, none]
        --bin                      Use a binary (application) template [default]
        --lib                      Use a library template
        --edition <YEAR>           Edition to set for the crate generated [possible values: 2015, 2018, 2021]
        --name <NAME>              Set the resulting package name, defaults to the directory name
    -v, --verbose                  Use verbose output (-vv very verbose/build.rs output)
        --color <WHEN>             Coloring: auto, always, never
        --frozen                   Require Cargo.lock and cache are up to date
        --locked                   Require Cargo.lock is up to date
        --offline                  Run without accessing the network
        --config <KEY=VALUE>...    Override a configuration value (unstable)
    -Z <FLAG>...                   Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
    -h, --help                     Prints help information

ARGS:
    <path>     [default: .]

Run `cargo help init` for more detailed information.

You can use --name to override the name of the crate