Skip to content

Commit 73cd749

Browse files
committed
move commands info into separate help screen
1 parent 8e8f2da commit 73cd749

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

main.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,6 @@ func LoadShortcuts() {
392392
// prints help to chat view
393393
func PrintHelp() {
394394
cmdPrefix := config.Config.General.CmdPrefix
395-
fmt.Fprintln(textView, "[::b]WhatsCLI "+VERSION+"[-]")
396-
fmt.Fprintln(textView, "")
397395
fmt.Fprintln(textView, "[-::u]Keys:[-::-]")
398396
fmt.Fprintln(textView, "")
399397
fmt.Fprintln(textView, "Global")
@@ -410,6 +408,15 @@ func PrintHelp() {
410408
fmt.Fprintln(textView, "[::b]", config.Config.Keymap.MessageRevoke, "[::-] = Revoke message")
411409
fmt.Fprintln(textView, "[::b]", config.Config.Keymap.MessageInfo, "[::-] = Info about message")
412410
fmt.Fprintln(textView, "")
411+
fmt.Fprintln(textView, "Config file in ->", config.GetConfigFilePath())
412+
fmt.Fprintln(textView, "")
413+
fmt.Fprintln(textView, "Type [::b]"+cmdPrefix+"commands[::-] to see all commands")
414+
fmt.Fprintln(textView, "")
415+
}
416+
417+
func PrintCommands() {
418+
cmdPrefix := config.Config.General.CmdPrefix
419+
fmt.Fprintln(textView, "")
413420
fmt.Fprintln(textView, "[-::u]Commands:[-::-]")
414421
fmt.Fprintln(textView, "")
415422
fmt.Fprintln(textView, "[-::-]Global[-::-]")
@@ -434,12 +441,10 @@ func PrintHelp() {
434441
fmt.Fprintln(textView, "[::b] "+cmdPrefix+"remove[::-] [user-id[] = Remove user from group")
435442
fmt.Fprintln(textView, "[::b] "+cmdPrefix+"admin[::-] [user-id[] = Set admin role for user in group")
436443
fmt.Fprintln(textView, "[::b] "+cmdPrefix+"removeadmin[::-] [user-id[] = Remove admin role for user in group")
444+
fmt.Fprintln(textView, "")
437445
fmt.Fprintln(textView, "Use[::b]", config.Config.Keymap.Copyuser, "[::-]to copy a selected user id to clipboard")
438446
fmt.Fprintln(textView, "Use[::b]", config.Config.Keymap.Pasteuser, "[::-]to paste clipboard to text input")
439447
fmt.Fprintln(textView, "")
440-
fmt.Fprintln(textView, "Configuration:")
441-
fmt.Fprintln(textView, " ->", config.GetConfigFilePath())
442-
fmt.Fprintln(textView, "")
443448
}
444449

445450
// called when text is entered by the user
@@ -453,13 +458,16 @@ func EnterCommand(key tcell.Key) {
453458
}
454459
cmdPrefix := config.Config.General.CmdPrefix
455460
if sndTxt == cmdPrefix+"help" {
456-
//command
457461
PrintHelp()
458462
textInput.SetText("")
459463
return
460464
}
465+
if sndTxt == cmdPrefix+"commands" {
466+
PrintCommands()
467+
textInput.SetText("")
468+
return
469+
}
461470
if sndTxt == cmdPrefix+"quit" {
462-
//command
463471
sessionManager.CommandChannel <- messages.Command{"disconnect", nil}
464472
app.Stop()
465473
return

0 commit comments

Comments
 (0)