From 48d72322231466a367c98dca921e2013576726f1 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Thu, 16 Jul 2026 17:16:48 +0200 Subject: [PATCH 1/3] clone: rename -p/--path flag to --working-dir Align bender clone's flag with bender snapshot's --working-dir, since both refer to the same working-directory concept (and share the same default value). --path was also easy to confuse with the unrelated `bender path` subcommand and path-dependency overrides. --- CHANGELOG.md | 2 ++ book/src/commands.md | 2 +- book/src/workflow/package_dev.md | 2 +- src/cmd/clone.rs | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da509645..f34fc7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +### Changed +- `bender clone`: rename `-p`/`--path` flag to `--working-dir` to match `bender snapshot`'s flag for the same concept. ## 0.32.1 - 2026-07-07 ### Added diff --git a/book/src/commands.md b/book/src/commands.md index b1447a79..88331565 100644 --- a/book/src/commands.md +++ b/book/src/commands.md @@ -132,7 +132,7 @@ Calling update with the `--fetch/-f` flag will force all git dependencies to be ## `clone` --- Clone dependency to make modifications -The `bender clone ` command checks out the package `PKG` into a directory (default `working_dir`, can be overridden with `-p / --path `). +The `bender clone ` command checks out the package `PKG` into a directory (default `working_dir`, can be overridden with `--working-dir `). To ensure the package is correctly linked in bender, the [`Bender.local`](./local.md) file is modified to include a `path` dependency override, linking to the corresponding package. This can be used for development of dependent packages within the parent repository, allowing to test uncommitted and committed changes, without the worry that bender would update the dependency. diff --git a/book/src/workflow/package_dev.md b/book/src/workflow/package_dev.md index 2e8a52be..7a6e37a0 100644 --- a/book/src/workflow/package_dev.md +++ b/book/src/workflow/package_dev.md @@ -11,7 +11,7 @@ Use the `clone` command to move a dependency from Bender's internal cache into a bender clone ``` -By default, the package is checked out into a `working_dir` folder (you can change this with `-p/--path`). Bender automatically: +By default, the package is checked out into a `working_dir` folder (you can change this with `--working-dir`). Bender automatically: 1. Performs a `git clone` of the dependency into that folder. 2. Adds a `path` override to your [`Bender.local`](../local.md) file. diff --git a/src/cmd/clone.rs b/src/cmd/clone.rs index 8188c99d..3630d691 100644 --- a/src/cmd/clone.rs +++ b/src/cmd/clone.rs @@ -28,8 +28,8 @@ pub struct CloneArgs { pub name: String, /// Relative directory to clone PKG into - #[arg(short, long, default_value = "working_dir")] - pub path: String, + #[arg(long, default_value = "working_dir")] + pub working_dir: String, } /// Execute the `clone` subcommand. @@ -37,7 +37,7 @@ pub fn run(sess: &Session, path: &Path, args: &CloneArgs) -> Result<()> { let dep = &args.name.to_lowercase(); let depref = sess.dependency_with_name(dep)?; - let path_mod = &args.path; // TODO make this option for config in the Bender.yml file? + let path_mod = &args.working_dir; // TODO make this option for config in the Bender.yml file? // Check current config for matches if sess.config.overrides.contains_key(dep) { match &sess.config.overrides[dep] { From 14a0306a7b7861173dc23a1af7246a7ab5db6078 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Thu, 16 Jul 2026 17:39:54 +0200 Subject: [PATCH 2/3] clone: keep -p/--path as hidden aliases for --working-dir Restores backwards compatibility for scripts using bender clone -p/--path after the previous rename to --working-dir. --- CHANGELOG.md | 2 +- src/cmd/clone.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34fc7a0..88b2562c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## Unreleased ### Changed -- `bender clone`: rename `-p`/`--path` flag to `--working-dir` to match `bender snapshot`'s flag for the same concept. +- `bender clone`: primary flag for the checkout directory is now `--working-dir`, matching `bender snapshot`'s flag for the same concept; `-p`/`--path` are kept as hidden aliases for backwards compatibility. ## 0.32.1 - 2026-07-07 ### Added diff --git a/src/cmd/clone.rs b/src/cmd/clone.rs index 3630d691..6fa74ac0 100644 --- a/src/cmd/clone.rs +++ b/src/cmd/clone.rs @@ -28,7 +28,7 @@ pub struct CloneArgs { pub name: String, /// Relative directory to clone PKG into - #[arg(long, default_value = "working_dir")] + #[arg(short = 'p', long, alias = "path", default_value = "working_dir")] pub working_dir: String, } From 152efc33cbec6da715fe999321bb2c960d1952fd Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Thu, 16 Jul 2026 17:43:20 +0200 Subject: [PATCH 3/3] clone: hide -p from --help, keep it as a working alias -p was still showing in help alongside --working-dir; use short_alias instead of short so it stays functional but hidden, consistent with the hidden --path long alias. --- src/cmd/clone.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/clone.rs b/src/cmd/clone.rs index 6fa74ac0..19a85afe 100644 --- a/src/cmd/clone.rs +++ b/src/cmd/clone.rs @@ -28,7 +28,7 @@ pub struct CloneArgs { pub name: String, /// Relative directory to clone PKG into - #[arg(short = 'p', long, alias = "path", default_value = "working_dir")] + #[arg(long, short_alias = 'p', alias = "path", default_value = "working_dir")] pub working_dir: String, }