Update build dependencies and edition
Use the 2021 Rust edition. To use current version of clap changes were adapted.
This commit is contained in:
parent
d5ef64171a
commit
1aab989000
13 changed files with 55 additions and 49 deletions
52
Cargo.lock
generated
52
Cargo.lock
generated
|
@ -13,9 +13,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.44"
|
version = "1.0.51"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"
|
checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "atty"
|
||||||
|
@ -42,9 +42,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.71"
|
version = "1.0.72"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd"
|
checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
|
@ -67,9 +67,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "3.0.0-beta.4"
|
version = "3.0.0-beta.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fcd70aa5597dbc42f7217a543f9ef2768b2ef823ba29036072d30e1d88e98406"
|
checksum = "feff3878564edb93745d58cf63e17b63f24142506e7a20c87a5521ed7bfb1d63"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -80,14 +80,14 @@ dependencies = [
|
||||||
"strsim",
|
"strsim",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
"textwrap",
|
"textwrap",
|
||||||
"vec_map",
|
"unicase",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "3.0.0-beta.4"
|
version = "3.0.0-beta.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b5bb0d655624a0b8770d1c178fb8ffcb1f91cc722cb08f451e3dc72465421ac"
|
checksum = "8b15c6b4f786ffb6192ffe65a36855bc1fc2444bcd0945ae16748dcd6ed7d0d3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
|
@ -157,9 +157,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.103"
|
version = "0.2.108"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6"
|
checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
|
@ -233,9 +233,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "os_str_bytes"
|
name = "os_str_bytes"
|
||||||
version = "3.1.0"
|
version = "4.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6acbef58a60fe69ab50510a55bc8cdd4d6cf2283d27ad338f54cb52747a9cf2d"
|
checksum = "addaa943333a514159c80c97ff4a93306530d965d27e139188283cd13e06a799"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "posixmq"
|
name = "posixmq"
|
||||||
|
@ -272,9 +275,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.29"
|
version = "1.0.32"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d"
|
checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
@ -313,9 +316,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.80"
|
version = "1.0.82"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
|
checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -380,6 +383,15 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicase"
|
||||||
|
version = "2.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
|
||||||
|
dependencies = [
|
||||||
|
"version_check",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-segmentation"
|
name = "unicode-segmentation"
|
||||||
version = "1.8.0"
|
version = "1.8.0"
|
||||||
|
@ -398,12 +410,6 @@ version = "0.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "vec_map"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
name = "mqrs"
|
name = "mqrs"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
authors = ["finga <mqrs@onders.org>"]
|
authors = ["finga <mqrs@onders.org>"]
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
repository = "https://git.onders.org/finga/mqrs"
|
repository = "https://git.onders.org/finga/mqrs"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -1,10 +1,10 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{crate_authors, crate_version, AppSettings, Clap};
|
use clap::{crate_authors, crate_version, AppSettings, Parser};
|
||||||
|
|
||||||
mod posix;
|
mod posix;
|
||||||
mod sysv;
|
mod sysv;
|
||||||
|
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
enum Backend {
|
enum Backend {
|
||||||
/// Handle POSIX message queues
|
/// Handle POSIX message queues
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
|
@ -14,7 +14,7 @@ enum Backend {
|
||||||
Sysv(SysvCommand),
|
Sysv(SysvCommand),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
enum PosixCommand {
|
enum PosixCommand {
|
||||||
Create(posix::Create),
|
Create(posix::Create),
|
||||||
Info(posix::Info),
|
Info(posix::Info),
|
||||||
|
@ -24,7 +24,7 @@ enum PosixCommand {
|
||||||
Recv(posix::Recv),
|
Recv(posix::Recv),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
enum SysvCommand {
|
enum SysvCommand {
|
||||||
Create(sysv::Create),
|
Create(sysv::Create),
|
||||||
Info(sysv::Info),
|
Info(sysv::Info),
|
||||||
|
@ -32,7 +32,7 @@ enum SysvCommand {
|
||||||
Unlink(sysv::Unlink),
|
Unlink(sysv::Unlink),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
#[clap(
|
#[clap(
|
||||||
version = crate_version!(),
|
version = crate_version!(),
|
||||||
author = crate_authors!(", "),
|
author = crate_authors!(", "),
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use log::{info, log_enabled, Level::Info};
|
use log::{info, log_enabled, Level::Info};
|
||||||
use posixmq::PosixMq;
|
use posixmq::PosixMq;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
/// Create a POSIX message queue
|
/// Create a POSIX message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Create {
|
pub struct Create {
|
||||||
/// Permissions (octal) to create the queue with
|
/// Permissions (octal) to create the queue with
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use posixmq::PosixMq;
|
use posixmq::PosixMq;
|
||||||
|
|
||||||
/// Print information about an existing message queue
|
/// Print information about an existing message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Info {
|
pub struct Info {
|
||||||
/// Name of the queue
|
/// Name of the queue
|
||||||
#[clap(value_name = "QUEUE")]
|
#[clap(value_name = "QUEUE")]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use chrono::{DateTime, Local};
|
use chrono::{DateTime, Local};
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use std::{fs, os::unix::fs::PermissionsExt};
|
use std::{fs, os::unix::fs::PermissionsExt};
|
||||||
|
|
||||||
/// Print a list of existing message queues
|
/// Print a list of existing message queues
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct List {
|
pub struct List {
|
||||||
/// Show all parameters
|
/// Show all parameters
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use chrono::{DateTime, Local};
|
use chrono::{DateTime, Local};
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use humantime::Duration;
|
use humantime::Duration;
|
||||||
use log::info;
|
use log::info;
|
||||||
use posixmq::PosixMq;
|
use posixmq::PosixMq;
|
||||||
use std::str;
|
use std::str;
|
||||||
|
|
||||||
/// Receive and print a message from a message queue
|
/// Receive and print a message from a message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Recv {
|
pub struct Recv {
|
||||||
/// Do not block
|
/// Do not block
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use chrono::DateTime;
|
use chrono::DateTime;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use humantime::Duration;
|
use humantime::Duration;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
/// Send a message to a message queue
|
/// Send a message to a message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Send {
|
pub struct Send {
|
||||||
/// Set a different priority, priority >= 0
|
/// Set a different priority, priority >= 0
|
||||||
#[clap(short, long, default_value = "0")]
|
#[clap(short, long, default_value = "0")]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
/// Delete a message queue
|
/// Delete a message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Unlink {
|
pub struct Unlink {
|
||||||
/// Name of the queue
|
/// Name of the queue
|
||||||
#[clap(value_name = "QUEUE")]
|
#[clap(value_name = "QUEUE")]
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use log::info;
|
use log::info;
|
||||||
use sysvmq::SysvMq;
|
use sysvmq::SysvMq;
|
||||||
|
|
||||||
/// Create a SysV message queue
|
/// Create a SysV message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Create {
|
pub struct Create {
|
||||||
/// Permissions (octal) to create the queue with (default: 0644)
|
/// Permissions (octal) to create the queue with (default: 0644)
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{BufRead, BufReader},
|
io::{BufRead, BufReader},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Print information about an existing message queue
|
/// Print information about an existing message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Info {
|
pub struct Info {
|
||||||
/// Id of the queue
|
/// Id of the queue
|
||||||
#[clap(short, long, required_unless_present_any = &["key"], conflicts_with = "key")]
|
#[clap(short, long, required_unless_present_any = &["key"], conflicts_with = "key")]
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{BufRead, BufReader},
|
io::{BufRead, BufReader},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Print a list of existing message queues
|
/// Print a list of existing message queues
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct List {}
|
pub struct List {}
|
||||||
|
|
||||||
impl List {
|
impl List {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
/// Delete a message queue
|
/// Delete a message queue
|
||||||
#[derive(Clap, Debug)]
|
#[derive(Debug, Parser)]
|
||||||
pub struct Unlink {
|
pub struct Unlink {
|
||||||
/// Id of the queue
|
/// Id of the queue
|
||||||
#[clap(
|
#[clap(
|
||||||
|
|
Loading…
Reference in a new issue