Compare commits

..

No commits in common. "0bc19a718bbfaf9e8257dd382367d06bb470b010" and "51ff562ac42136878f6ac4cd463207a0db24b324" have entirely different histories.

3 changed files with 8 additions and 14 deletions

View File

@ -11,12 +11,6 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
- [x] - [x]
# [0.1.0] - 2024-11-29
### Changed
- `-P` flag changed to `-r` for setting rcon password. This is to disambiguate it from the port (-p) flag.
# [0.0.3] - 2024-11-24 # [0.0.3] - 2024-11-24
### Changed ### Changed

View File

@ -93,15 +93,15 @@ rcon, err := q3rcon.New(
## Command line ## Command line
Pass `host`, `port` and `rconpass` as flags, for example: Pass `host`, `port` and `password` as flags, for example:
``` ```
q3rcon -h=localhost -p=30000 -r="rconpassword" "mapname" q3rcon -h=localhost -p=30000 -P="rconpassword" "mapname"
``` ```
- `host` defaults to "localhost" - `host` defaults to "localhost"
- `port` defaults to 28960 - `port` defaults to 28960
- `rconpass` defaults to "" - `password` defaults to ""
Arguments following the flags will be sent as rcon commands. You may send multiple arguments. 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: Pass `interactive (-i shorthand)` flag to enable interactive mode, for example:
``` ```
q3rcon -h=localhost -p=30000 -r="rconpassword" -i q3rcon -h=localhost -p=30000 -P="rconpassword" -i
``` ```
If interactive mode is enabled, any arguments sent on the command line will be ignored. If interactive mode is enabled, any arguments sent on the command line will be ignored.

View File

@ -27,7 +27,7 @@ func main() {
var ( var (
host string host string
port int port int
rconpass string password string
loglevel int loglevel int
) )
@ -35,8 +35,8 @@ func main() {
flag.StringVar(&host, "h", "localhost", "hostname of the server (shorthand)") flag.StringVar(&host, "h", "localhost", "hostname of the server (shorthand)")
flag.IntVar(&port, "port", 28960, "port of the server") flag.IntVar(&port, "port", 28960, "port of the server")
flag.IntVar(&port, "p", 28960, "port of the server (shorthand)") flag.IntVar(&port, "p", 28960, "port of the server (shorthand)")
flag.StringVar(&rconpass, "rconpass", "", "rcon password") flag.StringVar(&password, "password", "", "rcon password")
flag.StringVar(&rconpass, "r", "", "rcon password (shorthand)") flag.StringVar(&password, "P", "", "rcon password (shorthand)")
flag.BoolVar(&interactive, "interactive", false, "run in interactive mode") flag.BoolVar(&interactive, "interactive", false, "run in interactive mode")
flag.BoolVar(&interactive, "i", 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)) log.SetLevel(log.Level(loglevel))
} }
rcon, err := connectRcon(host, port, rconpass) rcon, err := connectRcon(host, port, password)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }