diff --git a/src/prs.rs b/src/prs.rs index 62ea480..bd36a7e 100644 --- a/src/prs.rs +++ b/src/prs.rs @@ -29,6 +29,18 @@ pub struct PrCommand { #[derive(Subcommand, Clone, Debug)] pub enum PrSubcommand { + /// Search a repository's pull requests + Search { + query: Option, + #[clap(long, short)] + labels: Option, + #[clap(long, short)] + creator: Option, + #[clap(long, short)] + assignee: Option, + #[clap(long, short)] + state: Option, + }, /// Create a new pull request Create { /// The branch to merge onto. @@ -45,55 +57,6 @@ pub enum PrSubcommand { #[clap(long)] body: Option, }, - /// Edit the contents of a pull request - Edit { - /// The pull request to edit. - pr: u64, - #[clap(subcommand)] - command: EditCommand, - }, - /// Merge a pull request - Merge { - /// The pull request to merge. - pr: u64, - /// The merge style to use. - #[clap(long, short)] - method: Option, - /// Option to delete the corresponding branch afterwards. - #[clap(long, short)] - delete: bool, - }, - /// Add a comment on a pull request - Comment { - /// The pull request to comment on. - pr: u64, - /// The text content of the comment. - /// - /// Not including this in the command will open your editor. - body: Option, - }, - /// Close a pull request, without merging. - Close { - /// The pull request to close. - pr: u64, - /// A comment to add before closing. - /// - /// Adding without an argument will open your editor - #[clap(long, short)] - with_msg: Option>, - }, - /// Search a repository's pull requests - Search { - query: Option, - #[clap(long, short)] - labels: Option, - #[clap(long, short)] - creator: Option, - #[clap(long, short)] - assignee: Option, - #[clap(long, short)] - state: Option, - }, /// View the contents of a pull request View { /// The pull request to view. @@ -113,6 +76,43 @@ pub enum PrSubcommand { #[clap(long, id = "NAME")] branch_name: Option, }, + /// Add a comment on a pull request + Comment { + /// The pull request to comment on. + pr: u64, + /// The text content of the comment. + /// + /// Not including this in the command will open your editor. + body: Option, + }, + /// Edit the contents of a pull request + Edit { + /// The pull request to edit. + pr: u64, + #[clap(subcommand)] + command: EditCommand, + }, + /// Close a pull request, without merging. + Close { + /// The pull request to close. + pr: u64, + /// A comment to add before closing. + /// + /// Adding without an argument will open your editor + #[clap(long, short)] + with_msg: Option>, + }, + /// Merge a pull request + Merge { + /// The pull request to merge. + pr: u64, + /// The merge style to use. + #[clap(long, short)] + method: Option, + /// Option to delete the corresponding branch afterwards. + #[clap(long, short)] + delete: bool, + }, /// Open a pull request in your browser Browse { /// The pull request to open in your browser.