diff --git a/CHANGELOG.md b/CHANGELOG.md index da509645..88b2562c 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`: 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/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..19a85afe 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, short_alias = 'p', alias = "path", 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] {