pub struct ImportArgs {
pub file: PathBuf,
pub dry_run: bool,
pub merge: bool,
pub force: bool,
pub strict: bool,
pub remap_ids: bool,
pub parent: Option<String>,
}Expand description
Arguments for the import subcommand
Fields§
§file: PathBufPath to the export file to import
dry_run: boolValidate import without modifying database
Parses the file, validates schema compatibility, and reports what would be imported without making any changes.
merge: boolMerge mode: add missing items, skip existing
By default, import replaces all project data. With –merge:
- Tasks: skip if ID already exists, insert if new
- Dependencies: skip if exact match exists
- Attachments: configurable via –attachment-mode
force: boolForce overwrite of existing data without prompting
In replace mode (default): skip confirmation prompt In merge mode: overwrite conflicts instead of skipping
strict: boolEnable strict validation mode
Rejects imports with:
- Circular dependencies (normally just warned)
- Missing referenced tasks
- Invalid status values
remap_ids: boolGenerate fresh IDs and remap all references
When enabled, every task receives a new petname ID and all references (dependencies, attachments, tags, state history) are updated to use the new IDs. This allows importing the same snapshot multiple times without ID collisions.
parent: Option<String>Attach imported tree under a parent task
When provided, root tasks in the imported snapshot (those with no “contains” dependency pointing to them) will be linked to the given parent task via a “contains” dependency. This allows importing a snapshot as a subtree of an existing task.
Implementations§
Source§impl ImportArgs
impl ImportArgs
Sourcepub fn is_gzipped(&self) -> bool
pub fn is_gzipped(&self) -> bool
Check if this is a gzipped file based on extension
Sourcepub fn import_mode(&self) -> &'static str
pub fn import_mode(&self) -> &'static str
Describe the import mode for logging
Trait Implementations§
Source§impl Args for ImportArgs
impl Args for ImportArgs
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
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Debug for ImportArgs
impl Debug for ImportArgs
Source§impl FromArgMatches for ImportArgs
impl FromArgMatches for ImportArgs
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>
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>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for ImportArgs
impl RefUnwindSafe for ImportArgs
impl Send for ImportArgs
impl Sync for ImportArgs
impl Unpin for ImportArgs
impl UnwindSafe for ImportArgs
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
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>
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>
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