Struct jj_cli::cli_util::CommandHelper
source · pub struct CommandHelper { /* private fields */ }Implementations§
source§impl CommandHelper
impl CommandHelper
pub fn app(&self) -> &Command
sourcepub fn cwd(&self) -> &Path
pub fn cwd(&self) -> &Path
Canonical form of the current working directory path.
A loaded Workspace::workspace_root() also returns a canonical path, so
relative paths can be easily computed from these paths.
pub fn string_args(&self) -> &Vec<String>
pub fn matches(&self) -> &ArgMatches
pub fn global_args(&self) -> &GlobalArgs
pub fn settings(&self) -> &UserSettings
pub fn resolved_config_values( &self, prefix: &[&str] ) -> Result<Vec<AnnotatedValue>, ConfigError>
pub fn revset_extensions(&self) -> &Arc<RevsetExtensions>
sourcepub fn parse_template<'a, C: Clone + 'a, L: TemplateLanguage<'a> + ?Sized>(
&self,
ui: &Ui,
language: &L,
template_text: &str,
wrap_self: impl Fn(PropertyPlaceholder<C>) -> L::Property
) -> Result<TemplateRenderer<'a, C>, CommandError>
pub fn parse_template<'a, C: Clone + 'a, L: TemplateLanguage<'a> + ?Sized>( &self, ui: &Ui, language: &L, template_text: &str, wrap_self: impl Fn(PropertyPlaceholder<C>) -> L::Property ) -> Result<TemplateRenderer<'a, C>, CommandError>
Parses template of the given language into evaluation tree.
This function also loads template aliases from the settings. Use
WorkspaceCommandHelper::parse_template() if you’ve already
instantiated the workspace helper.
pub fn operation_template_extensions( &self ) -> &[Arc<dyn OperationTemplateLanguageExtension>]
pub fn workspace_loader(&self) -> Result<&WorkspaceLoader, CommandError>
sourcepub fn workspace_helper(
&self,
ui: &mut Ui
) -> Result<WorkspaceCommandHelper, CommandError>
pub fn workspace_helper( &self, ui: &mut Ui ) -> Result<WorkspaceCommandHelper, CommandError>
Loads workspace and repo, then snapshots the working copy if allowed.
sourcepub fn workspace_helper_no_snapshot(
&self,
ui: &mut Ui
) -> Result<WorkspaceCommandHelper, CommandError>
pub fn workspace_helper_no_snapshot( &self, ui: &mut Ui ) -> Result<WorkspaceCommandHelper, CommandError>
Loads workspace and repo, but never snapshots the working copy. Most
commands should use workspace_helper() instead.
pub fn get_working_copy_factory( &self ) -> Result<&dyn WorkingCopyFactory, CommandError>
pub fn load_workspace(&self) -> Result<Workspace, CommandError>
pub fn resolve_operation( &self, ui: &mut Ui, repo_loader: &RepoLoader ) -> Result<Operation, CommandError>
pub fn for_loaded_repo( &self, ui: &mut Ui, workspace: Workspace, repo: Arc<ReadonlyRepo> ) -> Result<WorkspaceCommandHelper, CommandError>
Auto Trait Implementations§
impl Freeze for CommandHelper
impl !RefUnwindSafe for CommandHelper
impl !Send for CommandHelper
impl !Sync for CommandHelper
impl Unpin for CommandHelper
impl !UnwindSafe for CommandHelper
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> 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>
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 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>
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