rename filesystem-sync option to filesystem-sync-time

This commit is contained in:
postscriptum 2025-07-05 23:01:08 +03:00
parent fabc11f9cb
commit fd102a9715
3 changed files with 8 additions and 8 deletions

View file

@ -64,8 +64,8 @@ snac2nex -s /path/to/snac/storage -t /path/to/nex -u user1 -u user2
[default: "%Y/%m/%d %H:%M:%S"]
--filesystem-sync
Sync filesystem meta (e.g. time modified)
--filesystem-sync-time
Sync file meta with Snac entry time (e.g. time modified)
--filesystem-file-permissions <FILESYSTEM_FILE_PERMISSIONS>
Set new file permissions (macos, linux only)

View file

@ -48,9 +48,9 @@ pub struct Config {
#[arg(long, default_value_t = String::from("%Y/%m/%d %H:%M:%S"))]
pub format_updated: String,
/// Sync filesystem meta (e.g. time modified)
/// Sync file meta with Snac entry time (e.g. time modified)
#[arg(long, default_value_t = false)]
pub filesystem_sync: bool,
pub filesystem_sync_time: bool,
/// Set new file permissions (macos, linux only)
#[arg(long, value_parser = permissions)]

View file

@ -22,7 +22,7 @@ pub struct Nex {
filename: String,
is_cleanup: bool,
is_debug: bool,
is_filesystem_sync: bool,
is_filesystem_sync_time: bool,
template: Template,
users: HashMap<String, PathBuf>,
}
@ -71,7 +71,7 @@ impl Nex {
filename: config.format_filename.clone(),
is_cleanup: !config.keep,
is_debug: !config.daemon,
is_filesystem_sync: config.filesystem_sync,
is_filesystem_sync_time: config.filesystem_sync_time,
template,
users,
})
@ -189,7 +189,7 @@ impl Nex {
.sync(
&from,
&to,
if self.is_filesystem_sync {
if self.is_filesystem_sync_time {
Some(timestamp.into())
} else {
None
@ -290,7 +290,7 @@ impl Nex {
};
let mut f = fs::File::create(path)?;
f.write_all(data)?;
if self.is_filesystem_sync {
if self.is_filesystem_sync_time {
f.set_modified((*modified).into())?; // it's important to call after write
}
if let Some(ref p) = self.file_permissions {