From d04c9bb58f036956cd9227cbfa83d5acd83dbb57 Mon Sep 17 00:00:00 2001 From: piegames Date: Tue, 25 Feb 2025 15:41:30 +0100 Subject: [PATCH] Make --name a global arg Fixes #89 --- README.md | 4 +++- src/cli.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0edf550..2f49dec 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ Commands: Options: -d, --directory Base folder for sources.json and the boilerplate default.nix [env: NPINS_DIRECTORY=] [default: npins] - --name Add the pin with a custom name. If a pin with that name already exists, it willl be overwritten + --name Add the pin with a custom name. If a pin with that name already exists, it will be overwritten -n, --dry-run Don't actually apply the changes -h, --help Print help ``` @@ -227,6 +227,8 @@ Options: Track a branch instead of a release -d, --directory Base folder for sources.json and the boilerplate default.nix [env: NPINS_DIRECTORY=] [default: npins] + --name + Add the pin with a custom name. If a pin with that name already exists, it will be overwritten --at Use a specific commit/release instead of the latest. This may be a tag name, or a git revision when --branch is set --pre-releases diff --git a/src/cli.rs b/src/cli.rs index 469ef17..0b3bcec 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -393,8 +393,8 @@ pub enum AddCommands { #[derive(Debug, Parser)] pub struct AddOpts { /// Add the pin with a custom name. - /// If a pin with that name already exists, it willl be overwritten - #[arg(long)] + /// If a pin with that name already exists, it will be overwritten + #[arg(long, global = true)] pub name: Option, /// Don't actually apply the changes #[arg(short = 'n', long)]