From 32a46cda673e09f61c4fedc4e9ff3f9c6017ed43 Mon Sep 17 00:00:00 2001 From: Kinflou Date: Tue, 20 Oct 2026 18:01:08 +0800 Subject: [PATCH] build: drop the no-op --release flag Releasing is `comline release` now; a reserved `build --release` next to it only invites confusion. The build help also stops saying each build bumps the version: a build is recorded under a pre-release version. --- src/cli.rs | 13 +++++-------- src/commands/build.rs | 12 ++++-------- src/main.rs | 2 +- tests/cli/build.rs | 2 +- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index c7f7cb4..6bd9dd3 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -53,21 +53,18 @@ pub enum ReleaseLevel { #[derive(Subcommand, Debug)] pub enum Commands { - /// Compile the project and freeze a new immutable version + /// Compile the project and record a new build #[command(long_about = "\ Compile and validate every schema, then freeze the result into the project's \ -content-addressable store (`.comline/`). The project version is bumped \ -automatically to match the largest schema change since the last build \ -(major for breaking changes, minor for new features, patch for tweaks). +content-addressable store (`.comline/`). A build is recorded under a \ +pre-release version: the release it leads to and a count (`0.3.0-dev.2`). \ +The release follows the largest change since the last release; \ +`comline release` makes it. Examples: comline build comline build --watch")] Build { - /// Enable release optimizations (reserved; currently a no-op) - #[arg(short, long)] - release: bool, - /// Rebuild automatically when a schema or `config.idp` changes #[arg(short, long)] watch: bool, diff --git a/src/commands/build.rs b/src/commands/build.rs index b5d19fe..abd883f 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -10,21 +10,17 @@ use crate::commands::{core_err, ensure_project}; use crate::ui; use crate::watch; -pub fn run(work_dir: &Path, release: bool, watching: bool) -> Result<()> { +pub fn run(work_dir: &Path, watching: bool) -> Result<()> { ensure_project(work_dir)?; if watching { - watch::run(work_dir, "build", || build_once(work_dir, release)) + watch::run(work_dir, "build", || build_once(work_dir)) } else { - build_once(work_dir, release) + build_once(work_dir) } } -fn build_once(work_dir: &Path, release: bool) -> Result<()> { - if release { - ui::note("--release is reserved and currently has no effect"); - } - +fn build_once(work_dir: &Path) -> Result<()> { ui::step(format!("Building project{}", ui::at_path(work_dir))); let spinner = ui::spinner("compiling schemas"); let result = build::build(work_dir); diff --git a/src/main.rs b/src/main.rs index 10128fa..d73baf0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,7 +114,7 @@ fn run(cli: Cli) -> Result<()> { }; match cli.command { - Commands::Build { release, watch } => commands::build::run(&work_dir, release, watch), + Commands::Build { watch } => commands::build::run(&work_dir, watch), Commands::Check => commands::check::run(&work_dir), Commands::Generate { target, diff --git a/tests/cli/build.rs b/tests/cli/build.rs index 25ee46b..d12adc2 100644 --- a/tests/cli/build.rs +++ b/tests/cli/build.rs @@ -11,7 +11,7 @@ fn freezes_an_initial_version() { comline_cmd() .current_dir(&project) - .args(["build", "--release"]) + .arg("build") .assert() .success() .stderr(predicate::str::contains("Project built"))