Skip to content

Commit

Permalink
add basic cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Sep 4, 2023
1 parent 602c842 commit 9a97ce7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.2", features = ["derive"] }
network-interface = "1.0.1"
serde = { version = "1.0.188", features = ["derive"] }
toml = "0.7.6"
Expand Down
33 changes: 33 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
mod collectors;
pub mod configuration;

use clap::Parser;
use collectors::{dmi_collector, network_collector};
use configuration::config_parser::set_up_configuration;


/// The arguments that netbox-sync expects to get via the cli.
///
/// Arguments can be passed like this:
///
/// ```
/// netbox-sync --uri <NETBOX_URI> --token <NETBOX_TOKEN>
/// ```
///
/// These arguments override the ones defined in the `.nbs-config.toml`.
///
/// # Members
///
/// * `uri: String` - The URI to your Netbox instance.
/// * `token: String` - The authentication token for the netbox URI.
#[derive(Parser, Debug)]
#[command(author, version, about, long_about=None)]
struct Args {
/// URI to your Netbox instance
#[arg(short, long)]
uri: String,

/// Your API authentication token
#[arg(short, long)]
token: String,
}

fn main() {
let args: Args = Args::parse();

println!("Uri: {}\nToken: {}", args.uri, args.token);


let output: dmi_collector::DmiInformation = dmi_collector::construct_dmi_information();
println!("{:#?}", output);

Expand Down

0 comments on commit 9a97ce7

Please sign in to comment.