fix: use correct flag positional argument

This commit is contained in:
Jose Diaz-Gonzalez
2017-05-01 19:15:40 -06:00
committed by Michael Hobbs
parent 72eb8a06f0
commit 25759bcbb4
6 changed files with 20 additions and 20 deletions

View File

@@ -13,9 +13,9 @@ import (
// computes the ports for a given app container
func main() {
flag.Parse()
appName := flag.Arg(1)
procType := flag.Arg(2)
isHerokuishContainer := common.ToBool(flag.Arg(3))
appName := flag.Arg(0)
procType := flag.Arg(1)
isHerokuishContainer := common.ToBool(flag.Arg(2))
if procType != "web" {
return

View File

@@ -12,10 +12,10 @@ import (
// write the ipaddress to stdout for a given app container
func main() {
flag.Parse()
appName := flag.Arg(1)
procType := flag.Arg(2)
isHerokuishContainer := common.ToBool(flag.Arg(3))
containerId := flag.Arg(4)
appName := flag.Arg(0)
procType := flag.Arg(1)
isHerokuishContainer := common.ToBool(flag.Arg(2))
containerId := flag.Arg(3)
ipAddress := network.GetContainerIpaddress(appName, procType, isHerokuishContainer, containerId)
fmt.Fprintln(os.Stdout, ipAddress)

View File

@@ -13,7 +13,7 @@ import (
// returns the listeners (host:port combinations) for a given app container
func main() {
flag.Parse()
appName := flag.Arg(1)
appName := flag.Arg(0)
dokkuRoot := common.MustGetEnv("DOKKU_ROOT")
appRoot := strings.Join([]string{dokkuRoot, appName}, "/")

View File

@@ -12,10 +12,10 @@ import (
// write the port to stdout for a given app container
func main() {
flag.Parse()
appName := flag.Arg(1)
procType := flag.Arg(2)
isHerokuishContainer := common.ToBool(flag.Arg(3))
containerId := flag.Arg(4)
appName := flag.Arg(0)
procType := flag.Arg(1)
isHerokuishContainer := common.ToBool(flag.Arg(2))
containerId := flag.Arg(3)
port := network.GetContainerPort(appName, procType, isHerokuishContainer, containerId)
fmt.Fprintln(os.Stdout, port)

View File

@@ -12,10 +12,10 @@ import (
// writes the ip to disk
func main() {
flag.Parse()
appName := flag.Arg(1)
procType := flag.Arg(2)
containerIndex := flag.Arg(3)
ip := flag.Arg(4)
appName := flag.Arg(0)
procType := flag.Arg(1)
containerIndex := flag.Arg(2)
ip := flag.Arg(3)
if appName == "" {
common.LogFail("Please specify an app to run the command on")

View File

@@ -12,10 +12,10 @@ import (
// writes the port to disk
func main() {
flag.Parse()
appName := flag.Arg(1)
procType := flag.Arg(2)
containerIndex := flag.Arg(3)
port := flag.Arg(4)
appName := flag.Arg(0)
procType := flag.Arg(1)
containerIndex := flag.Arg(2)
port := flag.Arg(3)
if appName == "" {
common.LogFail("Please specify an app to run the command on")