feat(cli): add structopt
This commit is contained in:
parent
d22af2231c
commit
a9b3351d82
3 changed files with 32 additions and 1 deletions
2
migra-core/.gitignore → .gitignore
vendored
2
migra-core/.gitignore → .gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
/target
|
||||
/*/target
|
||||
Cargo.lock
|
11
migra-cli/Cargo.toml
Normal file
11
migra-cli/Cargo.toml
Normal file
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "migra-cli"
|
||||
version = "0.1.0"
|
||||
authors = ["Dmitriy Pleshevskiy <dmitriy@ideascup.me>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
migra-core = { path = '../migra-core' }
|
||||
structopt = "0.3.21"
|
20
migra-cli/src/main.rs
Normal file
20
migra-cli/src/main.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
#![deny(clippy::all)]
|
||||
|
||||
use structopt::StructOpt;
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
enum AppOpt {
|
||||
Init,
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
let opt = AppOpt::from_args();
|
||||
dbg!(&opt);
|
||||
|
||||
match opt {
|
||||
AppOpt::Init => {
|
||||
println!("unimplemented");
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue