Commit 8fd6b688 authored by Gerry Gunzenhauser's avatar Gerry Gunzenhauser

split cli out from generator lib

parent 93b12087
Pipeline #61994 failed with stages
in 8 minutes and 3 seconds
/target
target/
**/*.rs.bk
/.drive_tokens
......@@ -458,7 +458,7 @@ dependencies = [
]
[[package]]
name = "mikrotik-gen"
name = "mikrotik-gen-cli"
version = "0.1.0"
dependencies = [
"directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -466,12 +466,24 @@ dependencies = [
"hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper-rustls 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"mikrotik-gen-config 0.1.0",
"serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
"structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
"yup-oauth2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mikrotik-gen-config"
version = "0.1.0"
dependencies = [
"directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
"structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mime"
version = "0.2.6"
......
[package]
name = "mikrotik-gen"
version = "0.1.0"
authors = ["Gerry Gunzenhauser <gerry@linuxgl.ch>"]
edition = "2018"
[workspace]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
google-sheets4 = "1.0.10+20190625"
hyper = "^0.10"
hyper-rustls = "^0.6"
serde = "^1.0"
serde_json = "^1.0"
yup-oauth2 = "^1.0"
directories = "2.0.2"
structopt = "0.2.18"
itertools = "0.8.0"
\ No newline at end of file
members = [
"mikrotik-gen-cli",
"mikrotik-gen-lib",
]
[package]
name = "mikrotik-gen-cli"
version = "0.1.0"
authors = ["Gerry Gunzenhauser <gerry@linuxgl.ch>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
google-sheets4 = "1.0.10+20190625"
hyper = "^0.10"
hyper-rustls = "^0.6"
serde = "^1.0"
serde_json = "^1.0"
yup-oauth2 = "^1.0"
directories = "2.0.2"
structopt = "0.2.18"
itertools = "0.8.0"
mikrotik-gen-config = { path = "../mikrotik-gen-lib" }
......@@ -11,6 +11,9 @@ extern crate itertools;
#[macro_use]
extern crate structopt;
extern crate mikrotik_gen_config;
use mikrotik_gen_config::*;
use std::borrow::Borrow;
use std::collections::HashMap;
use std::convert::TryInto;
......@@ -28,10 +31,6 @@ use structopt::StructOpt;
use table_loader::*;
use std::path::PathBuf;
mod table_loader;
mod generator;
mod model;
#[derive(Debug,StructOpt)]
#[structopt(name="mikgen", about = "mikrotik switch config generator")]
struct CliOpts {
......
[package]
name = "mikrotik-gen-config"
version = "0.1.0"
authors = ["Gerry Gunzenhauser <gerry@linuxgl.ch>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = "^1.0"
serde_json = "^1.0"
directories = "2.0.2"
structopt = "0.2.18"
itertools = "0.8.0"
#![feature(option_flattening)]
pub mod generator;
pub mod model;
pub mod table_loader;
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}
......@@ -5,12 +5,6 @@ use std::fs;
use std::rc::Rc;
use std::vec::Vec;
use hyper::status::StatusCode::Conflict;
use oauth2::{Authenticator, ConsoleApplicationSecret, DefaultAuthenticatorDelegate, FlowType};
use sheets4::Error;
use sheets4::Sheets;
use sheets4::ValueRange;
use crate::model::*;
pub fn load_profiles(data: &[Vec<String>]) -> Vec<Rc<PortProfile>> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment