Compare commits
No commits in common. "main" and "v0.1.1" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,4 +20,3 @@ Cargo.lock
|
|||||||
|
|
||||||
/target
|
/target
|
||||||
/.idea
|
/.idea
|
||||||
error.log
|
|
||||||
|
11
Cargo.toml
11
Cargo.toml
@ -1,21 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "snot"
|
name = "snot"
|
||||||
version = "0.1.3"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["candifloss <candifloss.cc>"]
|
authors = ["candifloss <candifloss.cc>"]
|
||||||
description = "Simple NOTification"
|
|
||||||
license = "GPL-3.0-or-later"
|
|
||||||
repository = "https://git.candifloss.cc/candifloss/SNot"
|
|
||||||
homepage = "https://git.candifloss.cc/candifloss/SNot"
|
|
||||||
documentation = "https://git.candifloss.cc/candifloss/SNot"
|
|
||||||
readme = "README.md"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
zbus = "4.4.0"
|
zbus = "4.4.0"
|
||||||
zvariant = "4.2.0"
|
zvariant = "4.2.0"
|
||||||
tokio = { version = "1.40.0", features = ["full"] }
|
tokio = { version = "1.40.0", features = ["full"] }
|
||||||
futures-util = "0.3.30"
|
futures-util = "0.3.30"
|
||||||
serde = { version = "1.0.210", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0.128"
|
serde_json = "1.0.128"
|
||||||
rson_rs = "0.2.1"
|
rson_rs = "0.2.1"
|
||||||
argh = "0.1.12"
|
|
||||||
|
20
README.md
20
README.md
@ -8,20 +8,6 @@ Inspired by [`tiramisu`](https://github.com/Sweets/tiramisu)
|
|||||||
- Do one thing and do it well([DOTADIW](https://en.wikipedia.org/w/index.php?title=Unix_philosophy&useskin=vector#Do_One_Thing_and_Do_It_Well)) & [KISS](https://en.wikipedia.org/wiki/KISS_Principle) principle: no extra complicated features
|
- Do one thing and do it well([DOTADIW](https://en.wikipedia.org/w/index.php?title=Unix_philosophy&useskin=vector#Do_One_Thing_and_Do_It_Well)) & [KISS](https://en.wikipedia.org/wiki/KISS_Principle) principle: no extra complicated features
|
||||||
- (Not really a feature) Written in [`rust`](https://www.rust-lang.org/) using the [`zbus`](https://docs.rs/zbus/latest/zbus/) crate
|
- (Not really a feature) Written in [`rust`](https://www.rust-lang.org/) using the [`zbus`](https://docs.rs/zbus/latest/zbus/) crate
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```bash
|
|
||||||
snot --help
|
|
||||||
Usage: snot [-f <format>] [-v]
|
|
||||||
|
|
||||||
Print desktop notifications
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-f, --format select output format: r(rson), j(json, default), p(plain)
|
|
||||||
-v, --verbose verbose mode
|
|
||||||
--help display usage information
|
|
||||||
```
|
|
||||||
|
|
||||||
## Supported formats
|
## Supported formats
|
||||||
|
|
||||||
- Plain text - Print the output text. (✓ Just print it)
|
- Plain text - Print the output text. (✓ Just print it)
|
||||||
@ -33,6 +19,12 @@ Options:
|
|||||||
- Better handling of `json` and `rson` data
|
- Better handling of `json` and `rson` data
|
||||||
- Better ways to work with other programs
|
- Better ways to work with other programs
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
snot [r|j|p] [v]
|
||||||
|
```
|
||||||
|
|
||||||
## Why this project?
|
## Why this project?
|
||||||
|
|
||||||
- Something simple to work with [`EWW`](https://github.com/elkowar/eww) widgets
|
- Something simple to work with [`EWW`](https://github.com/elkowar/eww) widgets
|
||||||
|
@ -3,7 +3,68 @@ use crate::notification::Notification;
|
|||||||
use serde_json::{json, Value}; // json!() macro and Value type
|
use serde_json::{json, Value}; // json!() macro and Value type
|
||||||
|
|
||||||
impl Notification {
|
impl Notification {
|
||||||
|
// Actions, as json
|
||||||
|
pub fn actions_json(&self) -> Value {
|
||||||
|
if self.actions().is_empty() {
|
||||||
|
json!({}) // Empty JSON object if no actions
|
||||||
|
} else {
|
||||||
|
serde_json::Value::Object(
|
||||||
|
// Wrap the map into a serde_json::Value
|
||||||
|
self.actions()
|
||||||
|
.iter()
|
||||||
|
.map(|(id, label)| {
|
||||||
|
(id.clone(), json!(label)) // Create key-value pairs: id -> label
|
||||||
|
})
|
||||||
|
.collect::<serde_json::Map<_, _>>(), // Collect into a serde_json::Map
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default action, as json string
|
||||||
|
pub fn default_action_json(&self) -> Value {
|
||||||
|
match self.default_action() {
|
||||||
|
None => serde_json::Value::from("None"),
|
||||||
|
Some(actn) => serde_json::Value::String(actn.0),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hints, as json
|
||||||
|
pub fn hints_json(&self) -> Value {
|
||||||
|
if self.hints().is_empty() {
|
||||||
|
json!({}) // Empty JSON object if no hints
|
||||||
|
} else {
|
||||||
|
serde_json::Value::Object(
|
||||||
|
self.hints()
|
||||||
|
.iter()
|
||||||
|
.map(|(key, value)| {
|
||||||
|
(key.clone(), json!(value.to_string())) // Convert hint value to string
|
||||||
|
})
|
||||||
|
.collect::<serde_json::Map<_, _>>(), // Collect into a serde_json::Map
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The notification as a json object
|
||||||
pub fn json(&self) -> Value {
|
pub fn json(&self) -> Value {
|
||||||
json!(self)
|
// Initialize
|
||||||
|
let mut notif_json: Value = json!({
|
||||||
|
"app_name": &self.app_name(),
|
||||||
|
"replace_id": &self.replace_id(),
|
||||||
|
"icon": &self.icon(),
|
||||||
|
"summary": &self.summary(),
|
||||||
|
"body": &self.body(),
|
||||||
|
"hints": &self.hints_json(),
|
||||||
|
"expiration_timeout": self.expir_timeout(),
|
||||||
|
"urgency": self.urgency(),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Conditionally add the Actions fields
|
||||||
|
if let Value::Object(ref mut map) = notif_json {
|
||||||
|
if !self.actions().is_empty() {
|
||||||
|
map.insert("actions".to_string(), self.actions_json());
|
||||||
|
map.insert("default_action".to_string(), self.default_action_json());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notif_json
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
// This module deals with converting the notification object into rson format, which can be used instead of json if preferred
|
// This module deals with converting the notification object into rson format, which can be used instead of json if preferred
|
||||||
use crate::notification::Notification;
|
use crate::notification::Notification;
|
||||||
use rson_rs::de::Error as RsonError;
|
|
||||||
use rson_rs::ser::to_string as rson_string;
|
use rson_rs::ser::to_string as rson_string;
|
||||||
|
|
||||||
impl Notification {
|
impl Notification {
|
||||||
pub fn rson(&self) -> Result<String, RsonError> {
|
pub fn actions_rson(&self) -> String {
|
||||||
rson_string(self).map_err(|e| RsonError::Message(format!("RSON serialization error: {e}")))
|
if self.actions().is_empty() {
|
||||||
|
String::new()
|
||||||
|
} else {
|
||||||
|
rson_string(&self.actions()).unwrap()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn hints_rson(&self) -> String {
|
||||||
|
rson_string(&self.hints()).unwrap()
|
||||||
|
}
|
||||||
|
pub fn rson(&self) -> String {
|
||||||
|
rson_string(&self).unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
use serde::ser::{Serialize, SerializeMap, Serializer};
|
|
||||||
use serde_json::{Map, Value};
|
|
||||||
use std::collections::HashMap;
|
|
||||||
use zvariant::OwnedValue;
|
|
||||||
|
|
||||||
/// Serialize actions
|
|
||||||
/// # Errors
|
|
||||||
/// Will return an empty map if there are no actions
|
|
||||||
pub fn serialize_actions<S>(actions: &[String], serializer: S) -> Result<S::Ok, S::Error>
|
|
||||||
where
|
|
||||||
S: Serializer,
|
|
||||||
{
|
|
||||||
let mut map = Map::new();
|
|
||||||
|
|
||||||
// Actions are in pairs: [id, label, id, label, ...]
|
|
||||||
for pair in actions.chunks(2) {
|
|
||||||
if let [id, label] = pair {
|
|
||||||
map.insert(id.clone(), Value::String(label.clone()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
map.serialize(serializer)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Serialize hints
|
|
||||||
/// # Errors
|
|
||||||
/// Will return an empty map if there are no hints
|
|
||||||
pub fn serialize_hints<S>(
|
|
||||||
hints: &HashMap<String, OwnedValue>,
|
|
||||||
serializer: S,
|
|
||||||
) -> Result<S::Ok, S::Error>
|
|
||||||
where
|
|
||||||
S: Serializer,
|
|
||||||
{
|
|
||||||
// Start serializing the map
|
|
||||||
let mut map = serializer.serialize_map(Some(hints.len()))?;
|
|
||||||
for (key, value) in hints {
|
|
||||||
// Serialize each entry as desired
|
|
||||||
map.serialize_entry(key, &HintValueSerializer(value))?;
|
|
||||||
}
|
|
||||||
map.end()
|
|
||||||
}
|
|
||||||
|
|
||||||
// A custom struct to handle serialization of OwnedValue
|
|
||||||
struct HintValueSerializer<'a>(&'a OwnedValue);
|
|
||||||
|
|
||||||
impl Serialize for HintValueSerializer<'_> {
|
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
|
||||||
where
|
|
||||||
S: Serializer,
|
|
||||||
{
|
|
||||||
let signature = self.0.value_signature().to_string(); // Get signature
|
|
||||||
|
|
||||||
// Extract the raw value correctly
|
|
||||||
let raw_value = if let Ok(v) = self.0.downcast_ref::<u8>() {
|
|
||||||
Value::from(v) // BYTE: y
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<bool>() {
|
|
||||||
Value::Bool(v) // BOOLEAN: b
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<i16>() {
|
|
||||||
Value::from(v) // INT16: n
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<u16>() {
|
|
||||||
Value::from(v) // UINT16: q
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<i32>() {
|
|
||||||
Value::from(v) // INT32: i
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<u32>() {
|
|
||||||
Value::from(v) // UINT32: u
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<i64>() {
|
|
||||||
Value::from(v) // INT64: x
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<u64>() {
|
|
||||||
Value::from(v) // UINT64: t
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<f64>() {
|
|
||||||
Value::from(v) // DOUBLE: d
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<String>() {
|
|
||||||
Value::String(v.clone()) // STRING: s
|
|
||||||
} else if let Ok(v) = self.0.downcast_ref::<&str>() {
|
|
||||||
Value::String(v.to_string()) // str
|
|
||||||
} else {
|
|
||||||
Value::Null // Unsupported types: fallback to Null
|
|
||||||
}; // Not implemented: UNIX_FD: h, OBJECT_PATH: o, SIGNATURE: g
|
|
||||||
|
|
||||||
// Serialize the final structure as a map
|
|
||||||
let mut map = serializer.serialize_map(Some(2))?;
|
|
||||||
map.serialize_entry("signature", &signature)?;
|
|
||||||
map.serialize_entry("value", &raw_value)?;
|
|
||||||
map.end()
|
|
||||||
}
|
|
||||||
}
|
|
57
src/main.rs
57
src/main.rs
@ -2,19 +2,18 @@ pub mod formats {
|
|||||||
pub mod json;
|
pub mod json;
|
||||||
pub mod plain;
|
pub mod plain;
|
||||||
pub mod rson;
|
pub mod rson;
|
||||||
pub mod serde;
|
|
||||||
}
|
}
|
||||||
mod notification;
|
mod notification;
|
||||||
use notification::{to_notif, Notification};
|
use notification::{to_notif, Notification};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
pub mod optparse;
|
use std::env;
|
||||||
|
|
||||||
use futures_util::stream::TryStreamExt;
|
use futures_util::stream::TryStreamExt;
|
||||||
use zbus::{message::Body, Connection, Result};
|
use zbus::{message::Body, Connection, Result};
|
||||||
|
|
||||||
const SERVER_NAME: &str = "SNot"; // Server software name
|
const SERVER_NAME: &str = "SNot"; // Server software name
|
||||||
const VENDOR: &str = env!("CARGO_PKG_AUTHORS"); // Server software vendor
|
const VENDOR: &str = "candifloss.cc"; // Server software vendor
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION"); // Server software version, from Cargo.toml
|
const VERSION: &str = "0.1.0"; // Server software version
|
||||||
const SPEC_VERSION: &str = "0.42"; // DBus specification version
|
const SPEC_VERSION: &str = "0.42"; // DBus specification version
|
||||||
const NOTIF_INTERFACE: &str = "org.freedesktop.Notifications"; // DBus interface name
|
const NOTIF_INTERFACE: &str = "org.freedesktop.Notifications"; // DBus interface name
|
||||||
|
|
||||||
@ -32,28 +31,18 @@ fn server_properties() -> HashMap<String, String> {
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
// Options
|
let args: Vec<String> = env::args().collect();
|
||||||
let args: optparse::Cli = argh::from_env();
|
let op_format: &str = if args.is_empty() || args[1] == "j" {
|
||||||
|
"j" // Default value, json format
|
||||||
// Format: r|j|p
|
} else if args[1] == "p" {
|
||||||
let op_format = match args.format {
|
"p" // Plain format
|
||||||
Some(value) => {
|
} else if args[1] == "r" {
|
||||||
// Reject invalid format option
|
"r" // rson format
|
||||||
if ["r", "j", "p"].contains(&value.as_str()) {
|
} else {
|
||||||
value.clone()
|
"j"
|
||||||
} else {
|
|
||||||
// Exit with error code
|
|
||||||
return Err(zbus::Error::from(std::io::Error::new(
|
|
||||||
std::io::ErrorKind::InvalidInput,
|
|
||||||
"Invalid output format",
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None => "j".to_string(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Verbose mode. Off/false by default
|
let verbose: bool = (args.len() > 2) && (args[2] == "v");
|
||||||
let verbose = args.verbose;
|
|
||||||
|
|
||||||
let connection = Connection::session().await?;
|
let connection = Connection::session().await?;
|
||||||
connection
|
connection
|
||||||
@ -85,6 +74,9 @@ async fn main() -> Result<()> {
|
|||||||
println!("GetAll request received for interface: {interface_name}");
|
println!("GetAll request received for interface: {interface_name}");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if verbose {
|
||||||
|
println!("Unknown interface requested: {interface_name}");
|
||||||
|
}
|
||||||
// Reply with an error
|
// Reply with an error
|
||||||
connection
|
connection
|
||||||
.reply_error(
|
.reply_error(
|
||||||
@ -93,9 +85,6 @@ async fn main() -> Result<()> {
|
|||||||
&"Unknown interface".to_string(),
|
&"Unknown interface".to_string(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
if verbose {
|
|
||||||
println!("Unknown interface requested: {interface_name}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"GetServerInformation" => {
|
"GetServerInformation" => {
|
||||||
@ -109,7 +98,7 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
"GetCapabilities" => {
|
"GetCapabilities" => {
|
||||||
// Client requested server capabilities. Respond with the supported capabilities
|
// Client requested server capabilities. Respond with the supported capabilities
|
||||||
let capabilities = vec![/*"actions",*/ "body", "body-hyperlinks"]; // Add more LATER
|
let capabilities = vec!["actions", "body", "body-hyperlinks"]; // Add more LATER
|
||||||
connection.reply(&msg, &capabilities).await?;
|
connection.reply(&msg, &capabilities).await?;
|
||||||
if verbose {
|
if verbose {
|
||||||
println!("Request received: {member}\n\tCapabilities: {capabilities:?}");
|
println!("Request received: {member}\n\tCapabilities: {capabilities:?}");
|
||||||
@ -127,27 +116,23 @@ async fn main() -> Result<()> {
|
|||||||
// Convert the msg body to a Notification object
|
// Convert the msg body to a Notification object
|
||||||
let notif: Notification = to_notif(&msg_body)?;
|
let notif: Notification = to_notif(&msg_body)?;
|
||||||
// Handle the notif
|
// Handle the notif
|
||||||
match op_format.as_str() {
|
match op_format {
|
||||||
"j" => {
|
"j" => {
|
||||||
println!("{}", ¬if.json()); // Print the json version
|
println!("{}", ¬if.json()); // Print the json version
|
||||||
}
|
}
|
||||||
"r" => {
|
"r" => {
|
||||||
// Print the rson version
|
println!("{}", ¬if.rson()); // Print the plain version
|
||||||
match notif.rson() {
|
|
||||||
Ok(rson_string) => println!("{rson_string}"),
|
|
||||||
Err(e) => eprintln!("Failed to convert to RSON: {e}"),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"p" => {
|
"p" => {
|
||||||
println!("{}\n", ¬if.plain()); // Print the plain version
|
println!("{}\n", ¬if.plain()); // Print the plain version
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
println!("Onkown output format."); // This is probably unreachable
|
println!("Onkown output format.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"CloseNotification" => {
|
"CloseNotification" => {
|
||||||
// Client sent a 'close' signal. Extract notification ID of the notif to be closed from the message body
|
// Client sent a close signal. Extract notification ID of the notif to be closed from the message body
|
||||||
let notification_id: u32 = msg.body().deserialize()?; // This method has only one parameter, the id
|
let notification_id: u32 = msg.body().deserialize()?; // This method has only one parameter, the id
|
||||||
|
|
||||||
// Tracking notifications by their IDs, closing them, and other features may be implemented later
|
// Tracking notifications by their IDs, closing them, and other features may be implemented later
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use crate::formats::serde::{serialize_actions, serialize_hints};
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use zbus::{message::Body, Result};
|
use zbus::{message::Body, Result};
|
||||||
@ -18,10 +17,8 @@ pub struct Notification {
|
|||||||
// Notification content/body
|
// Notification content/body
|
||||||
body: String,
|
body: String,
|
||||||
// Action requests that can be sent back to the client - "Reply," "Mark as Read," "Play/Pause/Next," "Snooze/Dismiss," etc.
|
// Action requests that can be sent back to the client - "Reply," "Mark as Read," "Play/Pause/Next," "Snooze/Dismiss," etc.
|
||||||
#[serde(serialize_with = "serialize_actions")]
|
|
||||||
actions: Vec<String>,
|
actions: Vec<String>,
|
||||||
// Useful extra data - notif type, urgency, notif sound, icon data, etc.
|
// Useful extra data - notif type, urgency, notif sound, icon data, etc.
|
||||||
#[serde(serialize_with = "serialize_hints")]
|
|
||||||
hints: HashMap<String, OwnedValue>,
|
hints: HashMap<String, OwnedValue>,
|
||||||
// Seconds till this notif expires. Optional
|
// Seconds till this notif expires. Optional
|
||||||
expir_timeout: i32,
|
expir_timeout: i32,
|
||||||
@ -51,11 +48,30 @@ impl Notification {
|
|||||||
|
|
||||||
// Key:Val pairs of actions
|
// Key:Val pairs of actions
|
||||||
pub fn actions(&self) -> Vec<(String, String)> {
|
pub fn actions(&self) -> Vec<(String, String)> {
|
||||||
self.actions
|
let mut actions: Vec<(String, String)> = vec![];
|
||||||
.chunks(2)
|
let acts = &self.actions;
|
||||||
.map(|chunk| (chunk[0].clone(), chunk[1].clone()))
|
let act_len = acts.len();
|
||||||
.collect()
|
let mut i = 0;
|
||||||
|
while i < act_len {
|
||||||
|
// Action ID, used by the sender to id the clicked action
|
||||||
|
let action_id = &acts[i];
|
||||||
|
// Localised human-readable string that describes the action
|
||||||
|
let action_label = &acts[i + 1];
|
||||||
|
// Pair of (id, label)
|
||||||
|
let action_pair = (action_id.to_owned(), action_label.to_owned());
|
||||||
|
// Add it to the Vec
|
||||||
|
actions.push(action_pair);
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
actions
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
pub fn actions(&self) -> Vec<(String, String)> {
|
||||||
|
self.actions
|
||||||
|
.chunks(2)
|
||||||
|
.map(|chunk| (chunk[0].clone(), chunk[1].clone()))
|
||||||
|
.collect()
|
||||||
|
} */
|
||||||
|
|
||||||
// Hints
|
// Hints
|
||||||
pub fn hints(&self) -> &HashMap<String, OwnedValue> {
|
pub fn hints(&self) -> &HashMap<String, OwnedValue> {
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
use argh::FromArgs;
|
|
||||||
|
|
||||||
#[derive(FromArgs)]
|
|
||||||
/// Print desktop notifications
|
|
||||||
pub struct Cli {
|
|
||||||
/// select output format: r(rson), j(json, default), p(plain)
|
|
||||||
#[argh(option, short = 'f')]
|
|
||||||
pub format: Option<String>,
|
|
||||||
|
|
||||||
/// verbose mode
|
|
||||||
#[argh(switch, short = 'v')]
|
|
||||||
pub verbose: bool,
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user