diff --git a/Cargo.toml b/Cargo.toml index 155f2ab7..09ded89c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,9 +22,11 @@ members = [ resolver = "2" + [profile.release] lto = true strip = "none" opt-level = "s" codegen-units = 1 debug = 2 + \ No newline at end of file diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 289cf46b..5d7e96db 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "cli" -version = "0.1.0" +name = "snm" +version = "0.0.1" edition = "2021" +authors = ["ityuany"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -21,7 +22,7 @@ dialoguer = "0.11.0" env_logger = "0.11.2" serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.0.0", features = ["full"] } -clap = { version = "4.5.1", features = ["derive"] } +clap = { version = "4.5.7", features = ["derive","cargo"] } ansi_term = "0.12.1" regex = "1.10.4" glob = "0.3.1" diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index 0eed27e9..56f00ef7 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -1,4 +1,4 @@ -use clap::{command, Parser}; +use clap::{command, crate_authors, crate_name, crate_version, Parser}; use snm_command::SnmCommands; pub mod fig; @@ -8,11 +8,11 @@ pub mod snm_command; pub mod execute_cli; #[derive(Parser, Debug)] -#[clap( - name = "snm", - version = "1.0.0", - author = "Author ityuany <519495771@qq.com>" -)] +#[command( + name = crate_name!(), + author = crate_authors!(), + version = crate_version!(), + about = "snm = ni + fnm + corepack")] pub struct SnmCli { #[command(subcommand)] pub command: SnmCommands, diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index ac99b00b..fafd1c0c 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -1,5 +1,5 @@ use clap::Parser; -use cli::{execute_cli::execute_cli, SnmCli}; +use snm::{execute_cli::execute_cli, SnmCli}; use snm_config::parse_snm_config; use snm_current_dir::current_dir; use snm_utils::{ diff --git a/justfile b/justfile new file mode 100644 index 00000000..e5827b1f --- /dev/null +++ b/justfile @@ -0,0 +1,13 @@ + +build: + echo "Building the project..." + cargo b + +dev: + echo "Running the project..." + cargo watch -x build + +test: + echo "Running tests..." + cargo t +