File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff 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>"}`
315+ - `{c : add-proc, cmd: "<SHELL COMMAND>", name: "<PROC NAME>" }`
316316- `{c : duplicate-proc}`
317317- `{c : show-remove-proc}`
318318- `{c : remove-proc, id: "<PROCESS ID>"}`
Original file line number Diff line number Diff line change @@ -566,11 +566,15 @@ impl App {
566566 self . modal = Some ( AddProcModal :: new ( self . ev_tx . clone ( ) ) . boxed ( ) ) ;
567567 loop_action. render ( ) ;
568568 }
569- AppEvent :: AddProc { cmd } => {
569+ AppEvent :: AddProc { cmd, name } => {
570+ let name: String = match name {
571+ Some ( s) => s. to_string ( ) ,
572+ None => cmd. to_string ( ) ,
573+ } ;
570574 let proc_handle = create_proc (
571- cmd . to_string ( ) ,
575+ name . clone ( ) ,
572576 & ProcConfig {
573- name : cmd . to_string ( ) ,
577+ name : name . clone ( ) ,
574578 cmd : CmdConfig :: Shell {
575579 shell : cmd. to_string ( ) ,
576580 } ,
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ pub enum AppEvent {
3131 ForceRestartProc ,
3232 ShowAddProc ,
3333 ShowRenameProc ,
34- AddProc { cmd : String } ,
34+ AddProc { cmd : String , name : Option < String > } ,
3535 DuplicateProc ,
3636 ShowRemoveProc ,
3737 RemoveProc { id : usize } ,
@@ -79,7 +79,7 @@ impl AppEvent {
7979 AppEvent :: ForceRestartProc => "Force restart" . to_string ( ) ,
8080 AppEvent :: ShowAddProc => "New process dialog" . to_string ( ) ,
8181 AppEvent :: ShowRenameProc => "Rename process dialog" . to_string ( ) ,
82- AppEvent :: AddProc { cmd } => format ! ( "New process `{}`" , cmd) ,
82+ AppEvent :: AddProc { cmd, name } => format ! ( "New process `{}`" , cmd) ,
8383 AppEvent :: DuplicateProc => "Duplicate current process" . to_string ( ) ,
8484 AppEvent :: ShowRemoveProc => "Remove process dialog" . to_string ( ) ,
8585 AppEvent :: RemoveProc { id } => format ! ( "Remove process by id {}" , id) ,
You can’t perform that action at this time.
0 commit comments