pub struct Cli {
pub command: Commands,
pub output: Option<CliOutputMode>,
pub no_color: bool,
pub repo: Option<PathBuf>,
pub verbose: u8,
pub quiet: bool,
pub op_id: Option<String>,
}Expand description
Heddle: An AI-native version control system.
Fields§
§command: Commands§output: Option<CliOutputMode>Output format: text (default), json, or json-compact. See heddle help output-formats
no_color: boolDisable colored output.
repo: Option<PathBuf>Repository path (default: find .heddle in ancestors).
verbose: u8Increase verbosity.
quiet: boolDecrease verbosity.
op_id: Option<String>Operation id (UUID v4) for idempotent retries. See heddle help operation-ids
Implementations§
Source§impl Cli
impl Cli
Sourcepub fn user_config_or_exit() -> &'static UserConfig
pub fn user_config_or_exit() -> &'static UserConfig
Load and cache the process-wide user configuration.
pub fn output_mode(&self) -> Option<OutputMode>
Sourcepub fn open_repo(&self) -> Result<Repository>
pub fn open_repo(&self) -> Result<Repository>
Open the Heddle repository the command should act on: the --repo
path if given, otherwise the current working directory (resolved
lazily so a supplied --repo never touches the cwd).
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
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 moreSource§impl CliContext for Cli
impl CliContext for Cli
Source§fn repo_path(&self) -> Option<&Path>
fn repo_path(&self) -> Option<&Path>
--repo override; None means “use the process’s current
directory.”Source§fn operation_id_wire(&self) -> String
fn operation_id_wire(&self) -> String
--op-id override for idempotent gRPC calls. Empty string
means the caller did not supply one and the server should not
dedupe.Source§fn should_output_json(&self, repo_config: Option<&Config>) -> bool
fn should_output_json(&self, repo_config: Option<&Config>) -> bool
Resolves whether output should be JSON, encapsulating the
precedence between the
--json / --output cli flags, the
user’s global config, and (when supplied) the repo’s
output.format config. Hosted commands typically pass
Some(repo.config()) after opening the repo and None
otherwise.Source§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
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>
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
impl Parser for Cli
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
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> 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
Mutably borrows from an owned value. Read more
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request