From 227a2207fbc19df42049eb7f90b6bdac24658934 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Tue, 30 Jul 2024 18:10:11 -0400 Subject: [PATCH] docs: better clap ids --- src/issues.rs | 9 +++++++-- src/prs.rs | 10 +++++++++- src/release.rs | 2 +- src/repo.rs | 7 +++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/issues.rs b/src/issues.rs index 130a1ef..f2a97ee 100644 --- a/src/issues.rs +++ b/src/issues.rs @@ -23,25 +23,28 @@ pub enum IssueSubcommand { title: String, #[clap(long)] body: Option, - #[clap(long, short)] + #[clap(long, short, id = "[HOST/]OWNER/REPO")] repo: Option, }, Edit { + #[clap(id = "[REPO#]ID")] issue: IssueId, #[clap(subcommand)] command: EditCommand, }, Comment { + #[clap(id = "[REPO#]ID")] issue: IssueId, body: Option, }, Close { + #[clap(id = "[REPO#]ID")] issue: IssueId, #[clap(long, short)] with_msg: Option>, }, Search { - #[clap(long, short)] + #[clap(long, short, id = "[HOST/]OWNER/REPO")] repo: Option, query: Option, #[clap(long, short)] @@ -54,11 +57,13 @@ pub enum IssueSubcommand { state: Option, }, View { + #[clap(id = "[REPO#]ID")] id: IssueId, #[clap(subcommand)] command: Option, }, Browse { + #[clap(id = "[REPO#]ID")] id: IssueId, }, } diff --git a/src/prs.rs b/src/prs.rs index 9d38d5c..c8f7389 100644 --- a/src/prs.rs +++ b/src/prs.rs @@ -60,12 +60,13 @@ pub enum PrSubcommand { #[clap(long)] body: Option, /// The repo to create this issue on - #[clap(long, short)] + #[clap(long, short, id = "[HOST/]OWNER/REPO")] repo: Option, }, /// View the contents of a pull request View { /// The pull request to view. + #[clap(id = "[REPO#]ID")] id: Option, #[clap(subcommand)] command: Option, @@ -73,6 +74,7 @@ pub enum PrSubcommand { /// View the mergability and CI status of a pull request Status { /// The pull request to view. + #[clap(id = "[REPO#]ID")] id: Option, }, /// Checkout a pull request in a new branch @@ -80,6 +82,7 @@ pub enum PrSubcommand { /// The pull request to check out. /// /// Prefix with ^ to get a pull request from the parent repo. + #[clap(id = "ID")] pr: PrNumber, /// The name to give the newly created branch. /// @@ -90,6 +93,7 @@ pub enum PrSubcommand { /// Add a comment on a pull request Comment { /// The pull request to comment on. + #[clap(id = "[REPO#]ID")] pr: Option, /// The text content of the comment. /// @@ -99,6 +103,7 @@ pub enum PrSubcommand { /// Edit the contents of a pull request Edit { /// The pull request to edit. + #[clap(id = "[REPO#]ID")] pr: Option, #[clap(subcommand)] command: EditCommand, @@ -106,6 +111,7 @@ pub enum PrSubcommand { /// Close a pull request, without merging. Close { /// The pull request to close. + #[clap(id = "[REPO#]ID")] pr: Option, /// A comment to add before closing. /// @@ -116,6 +122,7 @@ pub enum PrSubcommand { /// Merge a pull request Merge { /// The pull request to merge. + #[clap(id = "[REPO#]ID")] pr: Option, /// The merge style to use. #[clap(long, short = 'M')] @@ -133,6 +140,7 @@ pub enum PrSubcommand { /// Open a pull request in your browser Browse { /// The pull request to open in your browser. + #[clap(id = "[REPO#]ID")] id: Option, }, } diff --git a/src/release.rs b/src/release.rs index 716c508..887be27 100644 --- a/src/release.rs +++ b/src/release.rs @@ -16,7 +16,7 @@ use crate::{ pub struct ReleaseCommand { #[clap(long, short = 'R')] remote: Option, - #[clap(long, short)] + #[clap(long, short, id = "[HOST/]OWNER/REPO")] repo: Option, #[clap(subcommand)] command: ReleaseSubcommand, diff --git a/src/repo.rs b/src/repo.rs index f870add..e294da0 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -305,6 +305,7 @@ pub enum RepoCommand { push: bool, }, Fork { + #[clap(id = "[HOST/]OWNER/REPO")] repo: RepoArg, #[clap(long)] name: Option, @@ -312,24 +313,30 @@ pub enum RepoCommand { remote: Option, }, View { + #[clap(id = "[HOST/]OWNER/REPO")] name: Option, #[clap(long, short = 'R')] remote: Option, }, Clone { + #[clap(id = "[HOST/]OWNER/REPO")] repo: RepoArg, path: Option, }, Star { + #[clap(id = "[HOST/]OWNER/REPO")] repo: RepoArg, }, Unstar { + #[clap(id = "[HOST/]OWNER/REPO")] repo: RepoArg, }, Delete { + #[clap(id = "[HOST/]OWNER/REPO")] repo: RepoArg, }, Browse { + #[clap(id = "[HOST/]OWNER/REPO")] name: Option, #[clap(long, short = 'R')] remote: Option,