diff --git a/README.md b/README.md index 3ce6e70..aa58325 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ snac2nex -s /path/to/snac/storage -t /path/to/nex -u user1 -u user2 * escaped with `%%` - [default: %H:%M:%S.txt] + [default: %H:%M:%S] --format-updated Post `{updated}` time format diff --git a/src/config.rs b/src/config.rs index e8b71a0..019b579 100644 --- a/src/config.rs +++ b/src/config.rs @@ -30,7 +30,7 @@ pub struct Config { /// Post filenames format /// /// * 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, /// Post `{updated}` time format diff --git a/src/nex.rs b/src/nex.rs index f1478c0..59d7204 100644 --- a/src/nex.rs +++ b/src/nex.rs @@ -128,7 +128,11 @@ impl Nex { ); // 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 Ok(())