Skip to content

Commit cc914e4

Browse files
committed
Small tweaks
1 parent b0b732d commit cc914e4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Commands are encoded as yaml. Available commands:
312312
- `{c: restart-proc}`
313313
- `{c: force-restart-proc}`
314314
- `{c: show-add-proc}`
315-
- `{c: add-proc, cmd: "<SHELL COMMAND>", name: "<PROC NAME>"}`
315+
- `{c: add-proc, cmd: "<SHELL COMMAND>", name: "<PROC NAME>"}` - Add proccess. `name` field is optional.
316316
- `{c: duplicate-proc}`
317317
- `{c: show-remove-proc}`
318318
- `{c: remove-proc, id: "<PROCESS ID>"}`

src/app.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,9 @@ impl App {
567567
loop_action.render();
568568
}
569569
AppEvent::AddProc { cmd, name } => {
570-
let name: String = match name {
571-
Some(s) => s.to_string(),
572-
None => cmd.to_string(),
570+
let name = match name {
571+
Some(s) => s,
572+
None => cmd,
573573
};
574574
let proc_handle = create_proc(
575575
name.clone(),

src/modal/add_proc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ impl Modal for AddProcModal {
5353
.app_sender
5454
.send(AppEvent::AddProc {
5555
cmd: self.input.value().to_string(),
56+
name: None,
5657
})
5758
.unwrap();
5859
// Skip because AddProc event will immediately rerender.

0 commit comments

Comments
 (0)