Skip to main content

Cli

Struct Cli 

Source
pub struct Cli {
Show 32 fields pub path: PathBuf, pub target_path: Option<PathBuf>, pub nofetch: bool, pub nonormalize: bool, pub nocache: bool, pub allowshallow: bool, pub output: Vec<OutputFormat>, pub output_file: Option<PathBuf>, pub show_variable: Option<String>, pub format: Option<String>, pub config: Option<PathBuf>, pub show_config: bool, pub override_config: Vec<String>, pub branch: Option<String>, pub lang: Option<String>, pub verbosity: Verbosity, pub log_file: Option<PathBuf>, pub diag: bool, pub update_assembly_info: Option<Vec<String>>, pub ensure_assembly_info: bool, pub update_project_files: Option<Vec<String>>, pub update_wix_version_file: bool, pub update_package_files: Option<Vec<String>>, pub url: Option<String>, pub username: Option<String>, pub password: Option<String>, pub commit: Option<String>, pub dynamic_repo_location: Option<PathBuf>, pub exec: Option<String>, pub exec_version: Option<String>, pub dry_run: bool, pub tui: bool,
}

Fields§

§path: PathBuf

Repository path (directory containing .git). Defaults to the current directory.

§target_path: Option<PathBuf>

Same as path but position-independent (upstream /targetpath).

§nofetch: bool

Disable fetch (no-op: this port does not fetch).

§nonormalize: bool

Disable normalization (no-op).

§nocache: bool

Disable disk cache read/write (<.git>/gitversion_cache).

§allowshallow: bool

Allow shallow clone (no-op: gix reads shallow repos too).

§output: Vec<OutputFormat>

Output format (json, dot-env, build-server). May be repeated.

§output_file: Option<PathBuf>

Output file path (writes the result to a file when set).

§show_variable: Option<String>

Print a single variable only (e.g. -v SemVer).

§format: Option<String>

Print using a format string (e.g. –format “{Major}.{Minor}”).

§config: Option<PathBuf>

Config file path.

§show_config: bool

Print the effective config as YAML and exit.

§override_config: Vec<String>

Inline config override (key=value). May be repeated.

§branch: Option<String>

Branch to compute for (instead of the current checkout).

§lang: Option<String>

Output language (ko/en/ja/zh). Falls back to LANG/LC_ALL when omitted.

§verbosity: Verbosity

Log verbosity.

§log_file: Option<PathBuf>

Write log output to a file (upstream /l), or console for stderr. Logs append; stdout stays clean.

§diag: bool

Diagnostic mode (Trace logging).

§update_assembly_info: Option<Vec<String>>

Update AssemblyInfo files (recursive search when no file is given).

§ensure_assembly_info: bool

Create the AssemblyInfo file if missing (with updateassemblyinfo).

§update_project_files: Option<Vec<String>>

Update version elements in project files (.csproj etc.; recursive when no file is given).

§update_wix_version_file: bool

Create GitVersion_WixVersion.wxi.

§update_package_files: Option<Vec<String>>

Update the version in package manifests (package.json/Cargo.toml/pyproject.toml). Recursive search when no file is given.

§url: Option<String>

Remote git repository URL (clone then compute when set). Requires --branch.

§username: Option<String>

Remote auth username (with --url).

§password: Option<String>

Remote auth password (with --url).

§commit: Option<String>

Commit ID to inspect (latest on the branch when omitted). With --url.

§dynamic_repo_location: Option<PathBuf>

Dynamic clone location (default: a temp directory).

§exec: Option<String>

prepare command to run after computing (version variables exposed as GitVersion_* env and {Var}).

§exec_version: Option<String>

Version-modifying command. Its stdout is applied as next-version and recomputed.

§dry_run: bool

Print exec hooks without actually running them.

§tui: bool

Launch the interactive Ratatui TUI.

Trait Implementations§

Source§

impl Args for Cli

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl CommandFactory for Cli

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Cli

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Cli

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Cli

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Cli

§

impl RefUnwindSafe for Cli

§

impl Send for Cli

§

impl Sync for Cli

§

impl Unpin for Cli

§

impl UnsafeUnpin for Cli

§

impl UnwindSafe for Cli

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more