#![allow(clippy::single_call_fn)]
use crate::cli::subcommands as sub;
#[non_exhaustive]
pub struct Flag;
impl Flag {
#[inline]
pub fn run(flag: &sub::Flag) {
match *flag {
sub::Flag::Persister => Self::persister(),
}
}
#[inline]
pub fn persister() {
println!(
"
Usage: postit <COMMAND> [--persister | -p] <PATH_OR_CONN>
Description:
Specifies the persister where the tasks will be read from and saved to.
It can be a file (CSV, JSON, etc.) or a database (SQLite, etc.). The persister
is defined in '.postit.toml', or you can override it with the `-p` flag.
There are currently 4 supported persisters:
- Files
- csv (e.g.: tasks.csv)
- json (e.g.: tasks.json)
- xml (e.g.: tasks.xml)
- Databases
- SQLite (e.g.: tasks.db, tasks.sqlite or tasks.sqlite3)
- MongoDB (e.g.: mongodb://user:pass@host:port)
- MongoDB Atlas (e.g.: mongodb+srv://user:pass@cluster)
How to use:
postit view --persister tasks.csv
postit view --persister tasks.db
postit view --persister mongodb://localhost:27017
postit view --persister mongodb+srv://my_user:my_pass@cluster.mongodb.net
..."
);
}
}