Remove pub declarations and move to posix::*

This is in order to prepare also for SysV message queues.
This commit is contained in:
finga 2021-06-30 22:46:33 +02:00
parent 606b4de524
commit c2ad74ff15
7 changed files with 24 additions and 18 deletions

View file

@ -1,12 +1,16 @@
use crate::{create::Create, info::Info, recv::Recv, send::Send, unlink::Unlink};
use anyhow::Result;
use clap::{crate_authors, crate_version, AppSettings, Clap};
mod create;
mod info;
mod recv;
mod send;
mod unlink;
mod posix;
#[derive(Clap, Debug)]
enum Command {
Create(posix::Create),
Info(posix::Info),
Unlink(posix::Unlink),
Send(posix::Send),
Recv(posix::Recv),
}
#[derive(Clap, Debug)]
#[clap(
@ -16,21 +20,12 @@ mod unlink;
global_setting = AppSettings::VersionlessSubcommands,
global_setting = AppSettings::InferSubcommands,
)]
pub struct Opts {
struct Opts {
/// Produce verbose output
#[clap(short, long, global = true)]
pub verbose: bool,
verbose: bool,
#[clap(subcommand)]
pub command: Command,
}
#[derive(Clap, Debug)]
pub enum Command {
Create(Create),
Info(Info),
Unlink(Unlink),
Send(Send),
Recv(Recv),
command: Command,
}
fn main() -> Result<()> {

11
src/posix.rs Normal file
View file

@ -0,0 +1,11 @@
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;