mirror of
https://github.com/szymon-jozef/libnotify-rs.git
synced 2026-10-27 19:20:43 +01:00
feat: add clap feature
This commit is contained in:
@@ -3,6 +3,7 @@ use crate::api::errors::LibnotifyError;
|
||||
use super::libnotify::*;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
||||
/// Notification urgency level. Refer to [libnotify docs](https://gnome.pages.gitlab.gnome.org/libnotify/enum.Urgency.html) for more info
|
||||
pub enum Urgency {
|
||||
/// Low urgency. Used for unimportant notifications
|
||||
@@ -46,6 +47,7 @@ pub enum HintValue {
|
||||
|
||||
/// Notification timeout, until close
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
||||
pub enum Timeout {
|
||||
#[allow(missing_docs)]
|
||||
Default,
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
//! This crate exposes two modules:
|
||||
//!
|
||||
//! # Api
|
||||
//! # Crate structure
|
||||
//! ## Api
|
||||
//! This module contains a basic wrapper for libnotify calls. It just translates data types, etc,
|
||||
//! so usage is basically the same as libnotify.
|
||||
//!
|
||||
//! # Wrappers
|
||||
//! ## Wrappers
|
||||
//! This module is a higher level abstraction over api. Recommended to use over api.
|
||||
//!
|
||||
//! # Features
|
||||
//!
|
||||
//! - clap – enables [clap] support for `Urgency` and `Timeout` enums
|
||||
//!
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
Reference in New Issue
Block a user