Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/src/osc.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,14 @@ OpenStack client rewritten in Rust
- `json`:
Json output
- `wide`:
Wide (Human readable table with extra attributes). Note: this has effect only in list operations)
Wide (Human readable table with extra attributes). Note: this has effect only in list operations

* `-f`, `--fields <FIELDS>` — Fields to return in the output (only in normal and wide mode)
* `-v`, `--verbose` — Verbosity level. Repeat to increase level
* `-p`, `--pretty` — Pretty print the output

Possible values: `true`, `false`

* `-v`, `--verbose` — Verbosity level. Repeat to increase level



Expand Down
19 changes: 10 additions & 9 deletions openstack_cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,27 @@ pub struct Cli {

/// Global CLI options
#[derive(Args)]
#[command(next_display_order = 900, next_help_heading = "Global options")]
pub struct GlobalOpts {
/// Name reference to the clouds.yaml entry for the cloud configuration
#[arg(long, env = "OS_CLOUD", global = true)]
#[arg(long, env = "OS_CLOUD", global = true, display_order = 900)]
pub os_cloud: Option<String>,

/// Output format
#[arg(short, long, global = true, value_enum)]
#[arg(short, long, global = true, value_enum, display_order = 910)]
pub output: Option<OutputFormat>,

/// Fields to return in the output (only in normal and wide mode)
#[arg(short, long, global=true, action=clap::ArgAction::Append)]
#[arg(short, long, global=true, action=clap::ArgAction::Append, display_order = 910)]
pub fields: Vec<String>,

/// Verbosity level. Repeat to increase level.
#[arg(short, long, global=true, action = clap::ArgAction::Count)]
pub verbose: u8,

/// Pretty print the output
#[arg(short, long, global=true, action = clap::ArgAction::SetTrue)]
#[arg(short, long, global=true, action = clap::ArgAction::SetTrue, display_order = 910)]
pub pretty: bool,

/// Verbosity level. Repeat to increase level.
#[arg(short, long, global=true, action = clap::ArgAction::Count, display_order = 920)]
pub verbose: u8,
}

/// Output format
Expand All @@ -85,7 +86,7 @@ pub enum OutputFormat {
/// Json output
Json,
/// Wide (Human readable table with extra attributes). Note: this has
/// effect only in list operations)
/// effect only in list operations
Wide,
}

Expand Down