Add documentation to the cli args
This commit is contained in:
parent
63b1f33a0a
commit
43e32a303d
2 changed files with 26 additions and 11 deletions
27
readme.md
27
readme.md
|
@ -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
|
||||
```
|
||||
|
||||
|
|
10
src/cli.rs
10
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<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,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue