Rename mode clap parameter to permissions

Rename the clap parameter when creating a new message queue `mode` to
`permissions`.
This commit is contained in:
finga 2021-06-22 01:36:00 +02:00
parent bcefd6241b
commit 4633b7a4d8

View file

@ -7,8 +7,8 @@ use std::fs;
#[derive(Clap, Debug)] #[derive(Clap, Debug)]
pub struct Create { pub struct Create {
/// Permissions (octal) to create the queue with /// Permissions (octal) to create the queue with
#[clap(short = 'p', long)] #[clap(short, long)]
mode: Option<String>, permissions: Option<String>,
/// Maximum number of messages in the queue /// Maximum number of messages in the queue
#[clap(short, long)] #[clap(short, long)]
capacity: Option<usize>, capacity: Option<usize>,
@ -38,7 +38,7 @@ impl Create {
pub fn run(&self, verbose: bool) -> Result<()> { pub fn run(&self, verbose: bool) -> Result<()> {
let mq = &mut posixmq::OpenOptions::readonly(); let mq = &mut posixmq::OpenOptions::readonly();
if let Some(m) = &self.mode { if let Some(m) = &self.permissions {
mq.mode(u32::from_str_radix(&m, 8)?); mq.mode(u32::from_str_radix(&m, 8)?);
} }