From 0b24767065d687e88c68fba3a3c801f4b9587451 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 23 Oct 2025 10:06:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20--skip-rules=20flag=20to=20in?= =?UTF-8?q?it=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/init_cli.rs | 29 +++++++++++++++++++++++++++++ src/cli/init_cli/tests.rs | 2 ++ 2 files changed, 31 insertions(+) diff --git a/src/cli/init_cli.rs b/src/cli/init_cli.rs index cefc275..9ca90c2 100644 --- a/src/cli/init_cli.rs +++ b/src/cli/init_cli.rs @@ -24,6 +24,9 @@ //! //! # Non-interactive setup (credential file copied manually later) //! cull-gmail init --config-dir ~/.cull-gmail +//! +//! # Skip rules.toml creation for ephemeral environments +//! cull-gmail init --skip-rules //! ``` //! //! ### Planning and Verification @@ -41,6 +44,15 @@ //! cull-gmail init --force //! ``` //! +//! ### Ephemeral Environments +//! ```bash +//! # Skip rules.toml creation when it's provided externally +//! cull-gmail init --skip-rules --config-dir /app/config +//! +//! # Skip rules with custom rules directory +//! cull-gmail init --skip-rules --rules-dir /mnt/rules +//! ``` +//! //! ## Security Considerations //! //! - **Credential Protection**: OAuth2 credential files are copied with 0600 permissions @@ -199,6 +211,23 @@ pub struct InitCli { help = "Prompt for missing information and confirmations" )] pub interactive: bool, + + /// Skip rules.toml file creation. + /// + /// When enabled, the rules.toml file will not be created during initialization. + /// This is useful for ephemeral compute environments where rules.toml is provided + /// externally (e.g., mounted from a volume or supplied via configuration management). + /// + /// The cull-gmail.toml configuration file will still reference the rules.toml path + /// with a comment indicating that it should be provided separately. + /// + /// If --rules-dir is also specified, the rules directory will be created but the + /// rules.toml file within it will not be generated. + #[arg( + long = "skip-rules", + help = "Do not create rules.toml; expect it to be provided externally" + )] + pub skip_rules: bool, } /// Operations that can be performed during initialization. diff --git a/src/cli/init_cli/tests.rs b/src/cli/init_cli/tests.rs index 743410a..1332b3e 100644 --- a/src/cli/init_cli/tests.rs +++ b/src/cli/init_cli/tests.rs @@ -30,6 +30,7 @@ mod unit_tests { force: false, dry_run: false, interactive: false, + skip_rules: false, } } @@ -42,6 +43,7 @@ mod unit_tests { force: true, dry_run: false, interactive: false, + skip_rules: false, } }