From cec61a9db75c02e4f0b9c258ea3bb4df42f0052c Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 26 Jul 2020 16:57:43 +0100 Subject: [PATCH] Big update to help text and add a simple description --- cmd/rove/main.go | 49 ++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/cmd/rove/main.go b/cmd/rove/main.go index b3a7ed6..2340d0d 100644 --- a/cmd/rove/main.go +++ b/cmd/rove/main.go @@ -22,24 +22,28 @@ var defaultDataPath = path.Join(home, ".local/share/") // Command usage func printUsage() { - fmt.Fprintf(os.Stderr, "Usage: rove COMMAND [ARGS...]\n") - fmt.Fprintln(os.Stderr, "\nCommands") - fmt.Fprintln(os.Stderr, "\tserver-status prints the server status") - fmt.Fprintln(os.Stderr, "\tregister NAME registers an account and stores it (use with -name)") - fmt.Fprintln(os.Stderr, "\tcommand COMMAND [VAL...] issue commands to rover, accepts multiple, see below") - fmt.Fprintln(os.Stderr, "\tradar gathers radar data for the current rover") - fmt.Fprintln(os.Stderr, "\tstatus gets status info for current rover") - fmt.Fprintln(os.Stderr, "\tconfig [HOST] outputs the local config info, optionally sets host") - fmt.Fprintln(os.Stderr, "\thelp outputs this usage information") - fmt.Fprintln(os.Stderr, "\tversion outputs version info") - fmt.Fprintln(os.Stderr, "\nRover commands:") - fmt.Fprintln(os.Stderr, "\ttoggle toggles the sails, either catching the wind, or charging from the sun") - fmt.Fprintln(os.Stderr, "\tstash stores the object at the rover location in the inventory") - fmt.Fprintln(os.Stderr, "\trepair uses an inventory object to repair the rover") - fmt.Fprintln(os.Stderr, "\tbroadcast MSG broadcast a simple ASCII triplet to nearby rovers") - fmt.Fprintln(os.Stderr, "\tsalvage salvages a dormant rover for parts") - fmt.Fprintln(os.Stderr, "\nEnvironment") - fmt.Fprintln(os.Stderr, "\tROVE_USER_DATA path to user data, defaults to "+defaultDataPath) + fmt.Fprintln(os.Stderr, "Usage: rove ARG [OPT...]") + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintln(os.Stderr, "Arguments:") + fmt.Fprintln(os.Stderr, "\tversion outputs version") + fmt.Fprintln(os.Stderr, "\thelp outputs this usage text") + fmt.Fprintln(os.Stderr, "\tconfig [HOST] outputs the local config, optionally sets host") + fmt.Fprintln(os.Stderr, "\tserver-status prints the server status") + fmt.Fprintln(os.Stderr, "\tregister NAME registers an account and spawns a rover") + fmt.Fprintln(os.Stderr, "\tradar prints radar data in ASCII form") + fmt.Fprintln(os.Stderr, "\tstatus gets rover status") + fmt.Fprintln(os.Stderr, "\tcommand CMD [VAL...] queues commands, accepts multiple, see below") + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintln(os.Stderr, "Rover commands:") + fmt.Fprintln(os.Stderr, "\ttoggle toggles the current sail mode") + fmt.Fprintln(os.Stderr, "\tstash stores the object at the rover location in the inventory") + fmt.Fprintln(os.Stderr, "\trepair repairs the rover using inventory item") + fmt.Fprintln(os.Stderr, "\tbroadcast MSG broadcast a simple ASCII triplet to nearby rovers") + fmt.Fprintln(os.Stderr, "\tsalvage salvages a dormant rover for parts") + fmt.Fprintln(os.Stderr, "\ttransfer transfer's control into a dormant rover") + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintln(os.Stderr, "Environment") + fmt.Fprintln(os.Stderr, "\tROVE_USER_DATA path to user data, defaults to "+defaultDataPath) } const gRPCport = 9090 @@ -356,6 +360,15 @@ func InnerMain(command string, args ...string) error { func main() { // Bail without any args if len(os.Args) == 1 { + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintln(os.Stderr, "m mm mmm m m mmm") + fmt.Fprintln(os.Stderr, "#\" \" #\" \"# \"m m\" #\" #") + fmt.Fprintln(os.Stderr, "# # # #m# #\"\"\"\"") + fmt.Fprintln(os.Stderr, "# \"#m#\" # \"#mm\"") + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintln(os.Stderr, "Rove is an asychronous nomadic game about exploring a planet as part of a loose community.") + fmt.Fprintln(os.Stderr, "Visit https://mdiluz.github.io/rove/ for more information.") + fmt.Fprintf(os.Stderr, "\n") printUsage() os.Exit(1) }