diff options
author | Joris | 2022-02-26 22:42:25 +0100 |
---|---|---|
committer | Joris | 2022-02-26 22:42:25 +0100 |
commit | 68285db2c187b350bb2b1707071382bd9fbaa2a5 (patch) | |
tree | be382be54bbaffd618af639728939cb88ed8e052 /src/main.rs | |
parent | f9f49285c5ecc76d3edfb0a54ffab53c2e296d7f (diff) |
Give database path from argument
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 8999a52..956e930 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,9 +3,18 @@ mod gui; mod model; use anyhow::Result; +use structopt::StructOpt; + +#[derive(StructOpt)] +#[structopt()] +struct Opt { + #[structopt(long, default_value = "database.db")] + database: String, +} fn main() -> Result<()> { - let conn = db::init()?; + let db_path = Opt::from_args().database; + let conn = db::init(&db_path)?; gui::run(conn); Ok(()) } |