Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric-Lefebvre committed Mar 9, 2021
0 parents commit 270565b
Show file tree
Hide file tree
Showing 7 changed files with 417 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
278 changes: 278 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "cli"
version = "0.1.0"
authors = ["Cedric Lefebvre <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
structopt = "0.3.15"
serde_yaml = "0.8.17"
serde = { version = "1.0.124", features = ["derive"] }
7 changes: 7 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
git_repo: git:....
environment:
GITHUB_USER: qwe
GITHUB_TOKEN: qwe
files:
- #filePath

36 changes: 36 additions & 0 deletions src/arguments.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use structopt::StructOpt;


#[derive(StructOpt)]
#[derive(Debug)]
#[structopt(about = "Backup/Restore tool")]
pub enum Cli {
#[structopt(about = "Configuration file")]
Config {
#[structopt(short = "e", long = "--path", help = "Path", default_value = "config.yaml")]
path: String,
},
#[structopt(about = "Backup configuration from local computer")]
Backup {
#[structopt(short = "e", long = "--path", help = "Path", default_value = "config.yaml")]
path: String,
},
#[structopt(about = "Restore configuration on local computer")]
Restore {
#[structopt(short = "e", long = "--path", help = "Path", default_value = "config.yaml")]
path: String,
}
}


pub fn get_args() -> () {
match Cli::from_args() {
Cli::Config { path } => {
println!("{:?}", path)
},
Cli::Backup { path } => {
println!("test")
}
_ => (),
}
}
Loading

0 comments on commit 270565b

Please sign in to comment.