Skip to content

Commit

Permalink
Merge pull request #456 from Nukesor/parse-all-signal-names
Browse files Browse the repository at this point in the history
Parse all signal names
  • Loading branch information
Nukesor authored Aug 21, 2023
2 parents 4cb610d + 28a113e commit 0b7aacd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.0] - unreleased

### Fixed

- Support parameter parsing for signal names with capslock (`SIGINT`) and short name (`INT`|`int`). [#455](https://github.com/Nukesor/pueue/issues/455).

## [3.2.0] - 2023-06-13

### Added
Expand Down
11 changes: 6 additions & 5 deletions pueue_lib/src/network/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,17 @@ impl_into_message!(PauseMessage, Message::Pause);
/// This is also needed for usage in clap, since nix's Signal doesn't implement [Display] and
/// [std::str::FromStr].
#[derive(PartialEq, Eq, Clone, Debug, Deserialize, Serialize, Display, EnumString)]
#[strum(ascii_case_insensitive)]
pub enum Signal {
#[strum(serialize = "SigInt", serialize = "sigint", serialize = "2")]
#[strum(serialize = "sigint", serialize = "int", serialize = "2")]
SigInt,
#[strum(serialize = "SigKill", serialize = "sigkill", serialize = "9")]
#[strum(serialize = "sigkill", serialize = "kill", serialize = "9")]
SigKill,
#[strum(serialize = "SigTerm", serialize = "sigterm", serialize = "15")]
#[strum(serialize = "sigterm", serialize = "term", serialize = "15")]
SigTerm,
#[strum(serialize = "SigCont", serialize = "sigcont", serialize = "18")]
#[strum(serialize = "sigcont", serialize = "cont", serialize = "18")]
SigCont,
#[strum(serialize = "SigStop", serialize = "sigstop", serialize = "19")]
#[strum(serialize = "sigstop", serialize = "stop", serialize = "19")]
SigStop,
}

Expand Down

0 comments on commit 0b7aacd

Please sign in to comment.