diff --git a/src/cli.rs b/src/cli.rs deleted file mode 100644 index 4148233..0000000 --- a/src/cli.rs +++ /dev/null @@ -1,27 +0,0 @@ -use crate::{create::Create, info::Info, recv::Recv, send::Send, unlink::Unlink}; -use clap::{crate_authors, crate_version, AppSettings, Clap}; - -#[derive(Clap, Debug)] -#[clap( - version = crate_version!(), - author = crate_authors!(", "), - setting = AppSettings::SubcommandRequiredElseHelp, - global_setting = AppSettings::VersionlessSubcommands, - global_setting = AppSettings::InferSubcommands, -)] -pub struct Opts { - /// Produce verbose output - #[clap(short, long, global = true)] - pub verbose: bool, - #[clap(subcommand)] - pub command: Command, -} - -#[derive(Clap, Debug)] -pub enum Command { - Create(Create), - Info(Info), - Unlink(Unlink), - Send(Send), - Recv(Recv), -} diff --git a/src/main.rs b/src/main.rs index d85fa83..8cf86b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ +use crate::{create::Create, info::Info, recv::Recv, send::Send, unlink::Unlink}; use anyhow::Result; -use clap::Clap; +use clap::{crate_authors, crate_version, AppSettings, Clap}; -mod cli; mod create; mod info; mod recv; @@ -9,7 +9,30 @@ mod send; mod unlink; mod utils; -use cli::{Command, Opts}; +#[derive(Clap, Debug)] +#[clap( + version = crate_version!(), + author = crate_authors!(", "), + setting = AppSettings::SubcommandRequiredElseHelp, + global_setting = AppSettings::VersionlessSubcommands, + global_setting = AppSettings::InferSubcommands, +)] +pub struct Opts { + /// Produce verbose output + #[clap(short, long, global = true)] + pub verbose: bool, + #[clap(subcommand)] + pub command: Command, +} + +#[derive(Clap, Debug)] +pub enum Command { + Create(Create), + Info(Info), + Unlink(Unlink), + Send(Send), + Recv(Recv), +} fn main() -> Result<()> { let opts: Opts = Opts::parse();