add kill
This commit is contained in:
parent
dbf872baeb
commit
f01661339e
1 changed files with 17 additions and 0 deletions
17
src/command/kill.rs
Normal file
17
src/command/kill.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#[derive(Default)]
|
||||
pub struct KillCommand {
|
||||
target: Option<super::Selector>
|
||||
}
|
||||
|
||||
impl KillCommand {
|
||||
pub fn target(mut self, target: super::Selector) -> Self {
|
||||
self.target = Some(target);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn build(self) -> super::Command {
|
||||
let target = self.target.unwrap_or(super::Selector::Executor);
|
||||
let s = format!("kill {target}");
|
||||
super::Command(s)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue