aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index b770fa9..d12015a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,19 +4,31 @@ use yaml_rust::yaml;
#[derive(clap::Parser, Debug)]
-#[clap()]
+#[clap(version)]
struct Args {
#[clap(subcommand)]
command: Command,
-
- #[clap(long)]
- database: String,
}
#[derive(clap::Subcommand, Debug)]
enum Command {
- Insert,
- Select,
+ Insert {
+ #[clap(long)]
+ database: String,
+
+ table_name: String,
+
+ input_file: Option<String>,
+ },
+
+ Select {
+ #[clap(long)]
+ database: String,
+
+ table_name: String,
+
+ record_id: String,
+ },
}
@@ -27,6 +39,14 @@ fn main() {
// Get column names from SQLite
+ match args.command {
+ a @ Command::Insert { .. } => {
+ dbg!(a.database);
+ }
+
+ a @ Command::Select { .. } => {}
+ };
+
let mut dbconn = rusqlite::Connection::open("./test.db").unwrap();
let text_data = std::fs::read_to_string("test2.yml").unwrap();