Struct jj_cli::cli_util::CommandHelper
source · pub struct CommandHelper { /* private fields */ }Implementations§
source§impl CommandHelper
impl CommandHelper
pub fn new( app: Command, cwd: PathBuf, string_args: Vec<String>, matches: ArgMatches, global_args: GlobalArgs, settings: UserSettings, layered_configs: LayeredConfigs, maybe_workspace_loader: Result<WorkspaceLoader, CommandError>, store_factories: StoreFactories, working_copy_factories: HashMap<String, Box<dyn WorkingCopyFactory>> ) -> Self
pub fn app(&self) -> &Command
pub fn cwd(&self) -> &Path
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>
sourcepub fn load_template_aliases(
&self,
ui: &Ui
) -> Result<TemplateAliasesMap, CommandError>
pub fn load_template_aliases( &self, ui: &Ui ) -> Result<TemplateAliasesMap, CommandError>
Loads template aliases from the configs.
For most commands that depend on a loaded repo, you should use
WorkspaceCommandHelper::template_aliases_map() instead.
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>
sourcepub fn for_stale_working_copy(
&self,
ui: &mut Ui
) -> Result<WorkspaceCommandHelper, CommandError>
pub fn for_stale_working_copy( &self, ui: &mut Ui ) -> Result<WorkspaceCommandHelper, CommandError>
Loads workspace that will diverge from the last working-copy operation.
Auto Trait Implementations§
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