From adebc61b98fda2becf9099511ef1ae42328b460b Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 29 Nov 2024 01:07:05 +0000 Subject: [PATCH] change -P flag to -r for setting rcon password update README --- README.md | 8 ++++---- cmd/q3rcon/main.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ff9b541..4e3cf21 100644 --- a/README.md +++ b/README.md @@ -93,15 +93,15 @@ rcon, err := q3rcon.New( ## Command line -Pass `host`, `port` and `password` as flags, for example: +Pass `host`, `port` and `rconpass` as flags, for example: ``` -q3rcon -h=localhost -p=30000 -P="rconpassword" "mapname" +q3rcon -h=localhost -p=30000 -r="rconpassword" "mapname" ``` - `host` defaults to "localhost" - `port` defaults to 28960 -- `password` defaults to "" +- `rconpass` defaults to "" Arguments following the flags will be sent as rcon commands. You may send multiple arguments. @@ -110,7 +110,7 @@ Arguments following the flags will be sent as rcon commands. You may send multip Pass `interactive (-i shorthand)` flag to enable interactive mode, for example: ``` -q3rcon -h=localhost -p=30000 -P="rconpassword" -i +q3rcon -h=localhost -p=30000 -r="rconpassword" -i ``` If interactive mode is enabled, any arguments sent on the command line will be ignored. diff --git a/cmd/q3rcon/main.go b/cmd/q3rcon/main.go index 43e63de..c9c765c 100644 --- a/cmd/q3rcon/main.go +++ b/cmd/q3rcon/main.go @@ -27,7 +27,7 @@ func main() { var ( host string port int - password string + rconpass string loglevel int ) @@ -35,8 +35,8 @@ func main() { flag.StringVar(&host, "h", "localhost", "hostname of the server (shorthand)") flag.IntVar(&port, "port", 28960, "port of the server") flag.IntVar(&port, "p", 28960, "port of the server (shorthand)") - flag.StringVar(&password, "password", "", "rcon password") - flag.StringVar(&password, "P", "", "rcon password (shorthand)") + flag.StringVar(&rconpass, "rconpass", "", "rcon password") + flag.StringVar(&rconpass, "r", "", "rcon password (shorthand)") flag.BoolVar(&interactive, "interactive", false, "run in interactive mode") flag.BoolVar(&interactive, "i", false, "run in interactive mode") @@ -49,7 +49,7 @@ func main() { log.SetLevel(log.Level(loglevel)) } - rcon, err := connectRcon(host, port, password) + rcon, err := connectRcon(host, port, rconpass) if err != nil { log.Fatal(err) }