pub struct JjCommandSpec { /* private fields */ }Expand description
A typed description of one jj command.
Implementations§
Source§impl JjCommandSpec
impl JjCommandSpec
Sourcepub fn render_read_only(
argv: impl IntoIterator<Item = impl Into<OsString>>,
) -> Self
pub fn render_read_only( argv: impl IntoIterator<Item = impl Into<OsString>>, ) -> Self
Creates a read-only jj command spec from command arguments after the jj binary.
Sourcepub fn confirm_mutation(
argv: impl IntoIterator<Item = impl Into<OsString>>,
safety: SafetyClass,
) -> Self
pub fn confirm_mutation( argv: impl IntoIterator<Item = impl Into<OsString>>, safety: SafetyClass, ) -> Self
Creates a jj command spec that must be previewed before mutation execution.
Sourcepub fn with_cwd(self, cwd: impl Into<PathBuf>) -> Self
pub fn with_cwd(self, cwd: impl Into<PathBuf>) -> Self
Sets the process working directory metadata.
Sourcepub fn with_repository(self, repository: impl Into<PathBuf>) -> Self
pub fn with_repository(self, repository: impl Into<PathBuf>) -> Self
Sets the repository path metadata.
Sourcepub fn with_global_options(self, global_options: GlobalOptions) -> Self
pub fn with_global_options(self, global_options: GlobalOptions) -> Self
Sets the global jj options.
Sourcepub fn with_stdin(self, stdin: impl Into<String>) -> Self
pub fn with_stdin(self, stdin: impl Into<String>) -> Self
Sets stdin text for a future command runner.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Sets the display title independently from the executable argv.
Sourcepub const fn with_mode(self, mode: ExecutionMode) -> Self
pub const fn with_mode(self, mode: ExecutionMode) -> Self
Sets the execution mode.
Sourcepub const fn with_safety(self, safety: SafetyClass) -> Self
pub const fn with_safety(self, safety: SafetyClass) -> Self
Sets the safety class.
Sourcepub const fn with_refresh_plan(self, refresh_plan: RefreshPlan) -> Self
pub const fn with_refresh_plan(self, refresh_plan: RefreshPlan) -> Self
Sets the refresh plan.
Sourcepub const fn global_options(&self) -> &GlobalOptions
pub const fn global_options(&self) -> &GlobalOptions
Returns global jj options owned by the spec.
Sourcepub fn global_argv(&self) -> Vec<OsString>
pub fn global_argv(&self) -> Vec<OsString>
Returns global jj arguments rendered before the command family.
Sourcepub fn process_argv(&self) -> Vec<OsString>
pub fn process_argv(&self) -> Vec<OsString>
Returns process arguments after the jj binary.
Sourcepub fn repository(&self) -> Option<&Path>
pub fn repository(&self) -> Option<&Path>
Returns the repository path metadata.
Sourcepub fn process_preview(&self) -> String
pub fn process_preview(&self) -> String
Returns a display-only process preview with global options before command arguments.
Sourcepub fn command_preview(&self) -> CommandPreview
pub fn command_preview(&self) -> CommandPreview
Returns a command preview suitable for confirmation UI.
Sourcepub const fn mode(&self) -> ExecutionMode
pub const fn mode(&self) -> ExecutionMode
Returns the execution mode.
Sourcepub const fn safety(&self) -> SafetyClass
pub const fn safety(&self) -> SafetyClass
Returns the safety class.
Sourcepub const fn refresh_plan(&self) -> RefreshPlan
pub const fn refresh_plan(&self) -> RefreshPlan
Returns the refresh plan.