mirror of
https://github.com/Xevion/r2park.git
synced 2025-12-10 22:08:11 -06:00
Use flag.Args() to handle flag + normal arguments
This commit is contained in:
5
main.go
5
main.go
@@ -158,8 +158,9 @@ func main() {
|
|||||||
log.Infof("Redis connection established (%s)", ping_result)
|
log.Infof("Redis connection established (%s)", ping_result)
|
||||||
|
|
||||||
command := ""
|
command := ""
|
||||||
if len(os.Args) > 1 {
|
args := flag.Args()
|
||||||
command = os.Args[1]
|
if len(args) > 1 {
|
||||||
|
command = args[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
switch command {
|
switch command {
|
||||||
|
|||||||
Reference in New Issue
Block a user