pub struct GlobalArgs {
pub api_key: Option<String>,
pub config_file: Option<PathBuf>,
pub format: Option<Format>,
pub wide: bool,
pub no_color: bool,
pub quiet: bool,
pub verbose: bool,
pub no_input: bool,
pub yes_count: u8,
pub retries: u32,
pub base_url: Option<String>,
pub base_prefix: Option<String>,
}Expand description
Top-level flags inherited by every subcommand.
Fields§
§api_key: Option<String>§config_file: Option<PathBuf>--config-file: alternate config TOML. None means the default path
(~/.config/qn/config.toml).
format: Option<Format>None means the user didn’t pass --format; resolve via config file
(then the TTY-aware default: Table on a TTY, Json off) when we
build the Ctx.
wide: bool§no_color: bool§quiet: bool§verbose: bool§no_input: bool§yes_count: u8§retries: u32Max automatic retries for read-only API calls (see crate::retry).
Default yields 0 (no retries) — the CLI default of 3 comes from clap.
base_url: Option<String>§base_prefix: Option<String>Optional path prefix inserted between the host and each sub-client’s
fixed suffix (e.g. /console-api). Requires base_url. Useful for
reverse-proxy / gateway environments and local servers that mount the
API under a prefix.
Implementations§
Source§impl GlobalArgs
impl GlobalArgs
Sourcepub fn resolve_format(&self, stdout_is_tty: bool) -> Format
pub fn resolve_format(&self, stdout_is_tty: bool) -> Format
Resolve the output format: CLI flag > config file > TTY-aware default
(Table on a TTY, Json off).
Used by Ctx::from_global and auth (which doesn’t build a Ctx).
Sourcepub fn resolve_output(&self, stdout_is_tty: bool) -> (Format, bool)
pub fn resolve_output(&self, stdout_is_tty: bool) -> (Format, bool)
Resolve (format, wide) together so we only read the config file once.
For each: CLI flag > config file > built-in default. The format default
is TTY-aware: Table when stdout is a terminal, Json otherwise (so
agents / piped callers get a structured format by default). --wide is
purely additive — the flag sets it true; the config file can also set
it true; otherwise it’s false.
Sourcepub fn resolve_config_path(&self) -> Option<PathBuf>
pub fn resolve_config_path(&self) -> Option<PathBuf>
The config file to read: --config-file if given, else the default path.
Trait Implementations§
Source§impl Clone for GlobalArgs
impl Clone for GlobalArgs
Source§fn clone(&self) -> GlobalArgs
fn clone(&self) -> GlobalArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GlobalArgs
impl Debug for GlobalArgs
Source§impl Default for GlobalArgs
impl Default for GlobalArgs
Source§fn default() -> GlobalArgs
fn default() -> GlobalArgs
Auto Trait Implementations§
impl Freeze for GlobalArgs
impl RefUnwindSafe for GlobalArgs
impl Send for GlobalArgs
impl Sync for GlobalArgs
impl Unpin for GlobalArgs
impl UnsafeUnpin for GlobalArgs
impl UnwindSafe for GlobalArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more