Add documentation to the cli args

This commit is contained in:
Daan Boerlage 2025-01-21 17:05:29 +01:00
parent 63b1f33a0a
commit 43e32a303d
Signed by: daan
GPG key ID: FCE070E1E4956606
2 changed files with 26 additions and 11 deletions

View file

@ -24,9 +24,9 @@ cargo install jirac
Usage: jirac <COMMAND>
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>
--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 <URL> --email <EMAIL> --token <TOKEN>
Options:
--url <URL>
--email <EMAIL>
--token <TOKEN>
--url <URL> Jira instance URL
--email <EMAIL> User email
--token <TOKEN> User Token
-h, --help Print help
```

View file

@ -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<String>,
/// Open the new ticket in a browser
#[arg(long)]
open: bool,
/// A markdown file
#[arg(value_name = "MARKDOWN_FILE")]
markdown_file: Option<PathBuf>,
},
/// 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,
},