From d260de5b0194ed46b98e89ce6d457588b8f327ec Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 20 Aug 2024 10:34:09 -0700 Subject: [PATCH 1/2] fix: Improve nu syntax. --- CHANGELOG.md | 6 ++++++ Cargo.lock | 4 ++-- Cargo.toml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b1ba6607..5d8f59193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ - [Rust](https://github.com/moonrepo/tools/blob/master/tools/rust/CHANGELOG.md) - [TOML schema](https://github.com/moonrepo/tools/blob/master/tools/internal-schema/CHANGELOG.md) +## Unreleased + +#### 🚀 Updates + +- Improved Nushell generated syntax. + ## 0.40.0 #### 💥 Breaking diff --git a/Cargo.lock b/Cargo.lock index 0959c42f3..1bb5865c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3169,9 +3169,9 @@ dependencies = [ [[package]] name = "starbase_shell" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4afd24bccc65a94bef7b43acd2b2362e32bcad0eb5674b95aae81cec58c59b" +checksum = "4ba21e6fa8b977f6c790c6f9addce2ecc583f8fa87bf807c195d31e058d4d111" dependencies = [ "miette", "regex", diff --git a/Cargo.toml b/Cargo.toml index 961f5c157..dabed8294 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ starbase_archive = { version = "0.8.4", features = [ ] } starbase_events = { version = "0.6.3" } starbase_sandbox = { version = "0.7.2" } -starbase_shell = { version = "0.5.5", features = ["miette"] } +starbase_shell = { version = "0.5.6", features = ["miette"] } starbase_styles = { version = "0.4.2" } starbase_utils = { version = "0.8.7", default-features = false, features = [ "json", From fc59072fefd3dae6094e9fdb2cd43d9ec8215481 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 20 Aug 2024 10:55:25 -0700 Subject: [PATCH 2/2] fix: Show config mode possible values. --- CHANGELOG.md | 4 ++++ Cargo.lock | 1 + crates/cli/Cargo.toml | 2 +- crates/core/Cargo.toml | 5 +++++ crates/core/src/proto_config.rs | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d8f59193..654cbd0f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ - Improved Nushell generated syntax. +#### 🐞 Fixes + +- Fixed `--help` not showing possible values for `--config-mode`. + ## 0.40.0 #### 💥 Breaking diff --git a/Cargo.lock b/Cargo.lock index 1bb5865c4..21b5e1c51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2308,6 +2308,7 @@ dependencies = [ name = "proto_core" version = "0.40.1" dependencies = [ + "clap", "indexmap 2.4.0", "miette", "minisign-verify", diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 4ddda3c51..c2d42cf8e 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -32,7 +32,7 @@ name = "proto-shim" path = "src/main_shim.rs" [dependencies] -proto_core = { version = "0.40.1", path = "../core" } +proto_core = { version = "0.40.1", path = "../core", features = ["clap"] } proto_installer = { version = "0.7.0", path = "../installer" } proto_pdk_api = { version = "0.23.0", path = "../pdk-api" } proto_shim = { version = "0.5.0", path = "../shim" } diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index ec2fdbbb0..6444cd3fb 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -18,6 +18,7 @@ version_spec = { version = "0.7.0", path = "../version-spec", features = [ warpgate = { version = "0.17.0", path = "../warpgate", features = [ "schematic", ] } +clap = { workspace = true, optional = true } indexmap = { workspace = true } miette = { workspace = true } minisign-verify = "0.2.1" @@ -49,3 +50,7 @@ uuid = { workspace = true } [dev-dependencies] starbase_sandbox = { workspace = true } tokio = { workspace = true } + +[features] +default = [] +clap = ["dep:clap"] diff --git a/crates/core/src/proto_config.rs b/crates/core/src/proto_config.rs index 377de5f29..23f777f4a 100644 --- a/crates/core/src/proto_config.rs +++ b/crates/core/src/proto_config.rs @@ -87,6 +87,7 @@ fn validate_reserved_words( derive_enum!( #[derive(ConfigEnum, Copy, Default)] + #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] pub enum ConfigMode { Global, Local,