aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorTeddy Wing2022-03-13 05:53:23 +0100
committerTeddy Wing2022-03-13 05:53:23 +0100
commit7e12b718aedc2990be51f1168e79b4b67261a477 (patch)
tree187bab4449868981b6dc5075ecd6d91cc4c62686 /src/main.rs
parenta43344fb70fe3ca041a0e442c5c3862ada8113e7 (diff)
downloadyaqlite-7e12b718aedc2990be51f1168e79b4b67261a477.tar.bz2
main(): Start adding command line argument parsing
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 0ec2724..b770fa9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,10 +1,30 @@
+use clap::Parser;
use rusqlite;
use yaml_rust::yaml;
+#[derive(clap::Parser, Debug)]
+#[clap()]
+struct Args {
+ #[clap(subcommand)]
+ command: Command,
+
+ #[clap(long)]
+ database: String,
+}
+
+#[derive(clap::Subcommand, Debug)]
+enum Command {
+ Insert,
+ Select,
+}
+
+
fn main() {
println!("Hello, world!");
+ let args = Args::parse();
+
// Get column names from SQLite
let mut dbconn = rusqlite::Connection::open("./test.db").unwrap();