diff --git a/src/bin/catar.rs b/src/bin/catar.rs index abd41b4b..c6dc75af 100644 --- a/src/bin/catar.rs +++ b/src/bin/catar.rs @@ -3,7 +3,7 @@ extern crate proxmox_backup; use failure::*; use proxmox_backup::tools; -use proxmox_backup::cli::command::*; +use proxmox_backup::cli::*; use proxmox_backup::api_schema::*; use proxmox_backup::api_schema::router::*; diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 131dab97..1ade06c1 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -5,7 +5,7 @@ use failure::*; use chrono::{Local, TimeZone}; use proxmox_backup::tools; -use proxmox_backup::cli::command::*; +use proxmox_backup::cli::*; use proxmox_backup::api_schema::*; use proxmox_backup::api_schema::router::*; use proxmox_backup::client::*; diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs index 3cc2d594..19aa3cd9 100644 --- a/src/bin/proxmox-backup-manager.rs +++ b/src/bin/proxmox-backup-manager.rs @@ -1,7 +1,7 @@ extern crate proxmox_backup; //use proxmox_backup::api2; -use proxmox_backup::cli::command::*; +use proxmox_backup::cli::*; fn datastore_commands() -> CommandLineInterface { diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 00000000..cdb91456 --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,14 @@ +//! Tools to create command line parsers +//! +//! We can use Schema deinititions to create command line parsers. +//! +//! + +mod environment; +pub use environment::*; + +mod command; +pub use command::*; + +mod getopts; +pub use getopts::*; diff --git a/src/cli/command.rs b/src/cli/command.rs index 5fad6560..6d4081a1 100644 --- a/src/cli/command.rs +++ b/src/cli/command.rs @@ -9,7 +9,7 @@ use crate::api_schema::router::*; //use crate::api_schema::config::*; use super::environment::CliEnvironment; -use crate::getopts; +use super::getopts; pub fn print_cli_usage() { diff --git a/src/cli/environment.rs b/src/cli/environment.rs index 183c02dd..3b5b8725 100644 --- a/src/cli/environment.rs +++ b/src/cli/environment.rs @@ -3,6 +3,7 @@ use crate::api_schema::router::*; use std::collections::HashMap; use serde_json::Value; +/// `RpcEnvironmet` implementation for command line tools pub struct CliEnvironment { result_attributes: HashMap, user: Option, diff --git a/src/getopts.rs b/src/cli/getopts.rs similarity index 100% rename from src/getopts.rs rename to src/cli/getopts.rs diff --git a/src/lib.rs b/src/lib.rs index 9bc6994a..25060588 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,16 +31,10 @@ pub mod storage { pub mod futures; } -pub mod cli { - - pub mod environment; - pub mod command; -} - +pub mod cli; pub mod api2; pub mod client; -pub mod getopts; pub mod auth_helpers;