From 43e32a303dd5642314066f4ad75e8f003e1f75db Mon Sep 17 00:00:00 2001 From: Daan Boerlage Date: Tue, 21 Jan 2025 17:05:29 +0100 Subject: [PATCH] Add documentation to the cli args --- readme.md | 27 ++++++++++++++++----------- src/cli.rs | 10 ++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/readme.md b/readme.md index d09efd0..9481120 100644 --- a/readme.md +++ b/readme.md @@ -24,9 +24,9 @@ cargo install jirac Usage: jirac Commands: - create - list - init + create Create a ticket + list Find tickets currently assigned to you + init Setup the configuration help Print this message or the help of the given subcommand(s) Options: @@ -37,13 +37,16 @@ Options: ### Creating a ticket ``` +Create a ticket + Usage: jirac create [OPTIONS] [MARKDOWN_FILE] Arguments: - [MARKDOWN_FILE] + [MARKDOWN_FILE] A markdown file Options: - --project + --project The project key in which to create the ticket + --open Open the new ticket in a browser -h, --help Print help ``` @@ -68,15 +71,15 @@ jirac create --project KEY ## Listing tickets ``` +Find tickets currently assigned to you + Usage: jirac list [OPTIONS] Options: - --json + --json Print json rather than pretty print -h, --help Print help ``` -For now this only lists tickets assigned to the calling user. - ## Configuration Get the following information: @@ -88,12 +91,14 @@ Get the following information: Then run the the `jirac init` command ``` +Setup the configuration + Usage: jirac init --url --email --token Options: - --url - --email - --token + --url Jira instance URL + --email User email + --token User Token -h, --help Print help ``` diff --git a/src/cli.rs b/src/cli.rs index 30e0376..136e472 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -10,25 +10,35 @@ pub struct Cli { #[derive(Subcommand)] pub enum Commands { + /// Create a ticket Create { + /// The project key in which to create the ticket #[arg(long)] project: Option, + /// Open the new ticket in a browser #[arg(long)] open: bool, + /// A markdown file #[arg(value_name = "MARKDOWN_FILE")] markdown_file: Option, }, + /// Find tickets currently assigned to you List { + /// Print json rather than pretty print #[arg(long)] json: bool, }, + /// Setup the configuration Init { + /// Jira instance URL #[arg(long)] url: String, + /// User email #[arg(long)] email: String, + /// User Token #[arg(long)] token: String, },