Show shortcut mappings in help screen [skip ci]
This commit is contained in:
parent
dbd6a3162d
commit
fb89448324
2
main.go
2
main.go
@ -119,7 +119,7 @@ func main() {
|
||||
|
||||
// Displays help message if no arguments provided or -h/--help is passed
|
||||
if len(args) == 0 || Contains(args, "-h") || Contains(args, "--help") || Contains(args, "help") {
|
||||
printHelpMessage(packageManagerCommand, useRootBool, rootCommand, commands, shortcuts, isOverridden)
|
||||
printHelpMessage(packageManagerCommand, useRootBool, rootCommand, commands, shortcuts, shortcutMappings, isOverridden)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
4
usage.go
4
usage.go
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// Print help screen
|
||||
func printHelpMessage(packageManagerCommand string, useRootBool bool, rootCommand string, commands []string, shortcuts []string, isOverridden bool) {
|
||||
func printHelpMessage(packageManagerCommand string, useRootBool bool, rootCommand string, commands []string, shortcuts []string, shortcutMappings []string, isOverridden bool) {
|
||||
fmt.Println("Arsen Musayelyan's Package Manager Wrapper")
|
||||
fmt.Print("Current package manager is: ", packageManagerCommand)
|
||||
if isOverridden { fmt.Println(" (overridden)") } else { fmt.Print("\n") }
|
||||
@ -19,7 +19,7 @@ func printHelpMessage(packageManagerCommand string, useRootBool bool, rootComman
|
||||
fmt.Println(strings.Join(commands, "\n"))
|
||||
fmt.Println()
|
||||
fmt.Println("The available shortcuts are:")
|
||||
fmt.Println(strings.Join(shortcuts, "\n"))
|
||||
for index, element := range shortcuts { fmt.Println(element + ":", shortcutMappings[index]) }
|
||||
fmt.Println()
|
||||
fmt.Println("The available flags are:")
|
||||
fmt.Println("--help, -h: Shows this help screen")
|
||||
|
Loading…
Reference in New Issue
Block a user