diff --git a/Cargo.lock b/Cargo.lock index 8034921..50ea407 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "heck" @@ -106,9 +106,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "indexmap" -version = "1.7.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg", "hashbrown", diff --git a/src/posix/create.rs b/src/create.rs similarity index 100% rename from src/posix/create.rs rename to src/create.rs diff --git a/src/posix/info.rs b/src/info.rs similarity index 100% rename from src/posix/info.rs rename to src/info.rs diff --git a/src/main.rs b/src/main.rs index ba152c7..a8a6481 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,16 +1,12 @@ +use crate::{create::Create, info::Info, recv::Recv, send::Send, unlink::Unlink}; use anyhow::Result; use clap::{crate_authors, crate_version, AppSettings, Clap}; -mod posix; - -#[derive(Clap, Debug)] -enum Command { - Create(posix::Create), - Info(posix::Info), - Unlink(posix::Unlink), - Send(posix::Send), - Recv(posix::Recv), -} +mod create; +mod info; +mod recv; +mod send; +mod unlink; #[derive(Clap, Debug)] #[clap( @@ -20,12 +16,21 @@ enum Command { global_setting = AppSettings::VersionlessSubcommands, global_setting = AppSettings::InferSubcommands, )] -struct Opts { +pub struct Opts { /// Produce verbose output #[clap(short, long, global = true)] - verbose: bool, + pub verbose: bool, #[clap(subcommand)] - command: Command, + pub command: Command, +} + +#[derive(Clap, Debug)] +pub enum Command { + Create(Create), + Info(Info), + Unlink(Unlink), + Send(Send), + Recv(Recv), } fn main() -> Result<()> { diff --git a/src/posix.rs b/src/posix.rs deleted file mode 100644 index d9e6266..0000000 --- a/src/posix.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod create; -mod info; -mod recv; -mod send; -mod unlink; - -pub use create::Create; -pub use info::Info; -pub use recv::Recv; -pub use send::Send; -pub use unlink::Unlink; diff --git a/src/posix/recv.rs b/src/recv.rs similarity index 100% rename from src/posix/recv.rs rename to src/recv.rs diff --git a/src/posix/send.rs b/src/send.rs similarity index 100% rename from src/posix/send.rs rename to src/send.rs diff --git a/src/posix/unlink.rs b/src/unlink.rs similarity index 100% rename from src/posix/unlink.rs rename to src/unlink.rs