2020-11-26 04:18:52 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Print help screen
|
2021-01-04 03:41:26 +00:00
|
|
|
func printHelpMessage(packageManagerCommand string, useRoot bool, rootCommand string, commands map[string]string, shortcuts map[string]string, isOverridden bool) {
|
2020-11-26 04:18:52 +00:00
|
|
|
fmt.Println("Arsen Musayelyan's Package Manager Wrapper")
|
2020-11-28 02:26:42 +00:00
|
|
|
fmt.Print("Current package manager is: ", packageManagerCommand)
|
2021-01-04 03:41:26 +00:00
|
|
|
if isOverridden {
|
|
|
|
fmt.Println(" (overridden)")
|
|
|
|
} else {
|
|
|
|
fmt.Print("\n")
|
|
|
|
}
|
|
|
|
if useRoot {
|
|
|
|
fmt.Println("Using root with command:", rootCommand)
|
|
|
|
} else {
|
|
|
|
fmt.Println("Not using root")
|
|
|
|
}
|
2020-11-26 04:18:52 +00:00
|
|
|
fmt.Println()
|
|
|
|
fmt.Println("Usage: pak <command> [package]")
|
|
|
|
fmt.Println("Example: pak in hello")
|
|
|
|
fmt.Println()
|
|
|
|
fmt.Println("The available commands are:")
|
2021-01-04 03:41:26 +00:00
|
|
|
for command, mapping := range commands {
|
|
|
|
fmt.Println(command+":", mapping)
|
|
|
|
}
|
2020-11-26 04:18:52 +00:00
|
|
|
fmt.Println()
|
|
|
|
fmt.Println("The available shortcuts are:")
|
2021-01-04 03:41:26 +00:00
|
|
|
for shortcut, mapping := range shortcuts {
|
|
|
|
fmt.Println(shortcut+":", mapping)
|
|
|
|
}
|
2020-11-26 04:18:52 +00:00
|
|
|
fmt.Println()
|
|
|
|
fmt.Println("The available flags are:")
|
|
|
|
fmt.Println("--help, -h: Shows this help screen")
|
|
|
|
fmt.Println("--root, -r: Bypasses root user check")
|
|
|
|
fmt.Println()
|
|
|
|
fmt.Println("Pak uses a string distance algorithm, so `pak in` is valid as is `pak inst` or `pak install`")
|
2021-01-04 03:41:26 +00:00
|
|
|
}
|