Compare commits
2 commits
606b4de524
...
6a41335603
Author | SHA1 | Date | |
---|---|---|---|
6a41335603 | |||
c2ad74ff15 |
8 changed files with 28 additions and 22 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -76,9 +76,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.9.1"
|
version = "0.11.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
|
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
|
@ -106,9 +106,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "1.6.2"
|
version = "1.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3"
|
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
|
|
31
src/main.rs
31
src/main.rs
|
@ -1,12 +1,16 @@
|
||||||
use crate::{create::Create, info::Info, recv::Recv, send::Send, unlink::Unlink};
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{crate_authors, crate_version, AppSettings, Clap};
|
use clap::{crate_authors, crate_version, AppSettings, Clap};
|
||||||
|
|
||||||
mod create;
|
mod posix;
|
||||||
mod info;
|
|
||||||
mod recv;
|
#[derive(Clap, Debug)]
|
||||||
mod send;
|
enum Command {
|
||||||
mod unlink;
|
Create(posix::Create),
|
||||||
|
Info(posix::Info),
|
||||||
|
Unlink(posix::Unlink),
|
||||||
|
Send(posix::Send),
|
||||||
|
Recv(posix::Recv),
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Clap, Debug)]
|
||||||
#[clap(
|
#[clap(
|
||||||
|
@ -16,21 +20,12 @@ mod unlink;
|
||||||
global_setting = AppSettings::VersionlessSubcommands,
|
global_setting = AppSettings::VersionlessSubcommands,
|
||||||
global_setting = AppSettings::InferSubcommands,
|
global_setting = AppSettings::InferSubcommands,
|
||||||
)]
|
)]
|
||||||
pub struct Opts {
|
struct Opts {
|
||||||
/// Produce verbose output
|
/// Produce verbose output
|
||||||
#[clap(short, long, global = true)]
|
#[clap(short, long, global = true)]
|
||||||
pub verbose: bool,
|
verbose: bool,
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
pub command: Command,
|
command: Command,
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clap, Debug)]
|
|
||||||
pub enum Command {
|
|
||||||
Create(Create),
|
|
||||||
Info(Info),
|
|
||||||
Unlink(Unlink),
|
|
||||||
Send(Send),
|
|
||||||
Recv(Recv),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
|
|
11
src/posix.rs
Normal file
11
src/posix.rs
Normal 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;
|
Loading…
Reference in a new issue