mirror of
https://codeberg.org/postscriptum/snac2nex.git
synced 2026-04-01 13:45:28 +00:00
update default file name
This commit is contained in:
parent
dfb4f8b3a8
commit
1c9b3621e6
3 changed files with 7 additions and 3 deletions
|
|
@ -46,7 +46,7 @@ snac2nex -s /path/to/snac/storage -t /path/to/nex -u user1 -u user2
|
||||||
|
|
||||||
* escaped with `%%`
|
* escaped with `%%`
|
||||||
|
|
||||||
[default: %H:%M:%S.txt]
|
[default: %H:%M:%S]
|
||||||
|
|
||||||
--format-updated <FORMAT_UPDATED>
|
--format-updated <FORMAT_UPDATED>
|
||||||
Post `{updated}` time format
|
Post `{updated}` time format
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ pub struct Config {
|
||||||
/// Post filenames format
|
/// Post filenames format
|
||||||
///
|
///
|
||||||
/// * escaped with `%%`
|
/// * escaped with `%%`
|
||||||
#[arg(long, default_value_t = String::from("%H:%M:%S.txt"))]
|
#[arg(long, default_value_t = String::from("%H:%M:%S"))]
|
||||||
pub format_filename: String,
|
pub format_filename: String,
|
||||||
|
|
||||||
/// Post `{updated}` time format
|
/// Post `{updated}` time format
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,11 @@ impl Nex {
|
||||||
);
|
);
|
||||||
|
|
||||||
// write the data
|
// write the data
|
||||||
p.push(published.format(&self.filename).to_string());
|
p.push(
|
||||||
|
published
|
||||||
|
.format(&self.filename.trim_matches(std::path::MAIN_SEPARATOR))
|
||||||
|
.to_string(),
|
||||||
|
);
|
||||||
fs::write(p, c)?; // @TODO skip overwrite operations
|
fs::write(p, c)?; // @TODO skip overwrite operations
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue