dictyBase/modware-annotation

View on GitHub
internal/app/validate/validate.go

Summary

Maintainability
A
0 mins
Test Coverage
package validate

import (
    "fmt"

    "github.com/urfave/cli"
)

const errNo = 2

func ServerArgs(clt *cli.Context) error {
    for _, param := range []string{
        "arangodb-pass",
        "arangodb-database",
        "arangodb-user",
        "nats-host",
        "nats-port",
    } {
        if len(clt.String(param)) == 0 {
            return cli.NewExitError(
                fmt.Sprintf("argument %s is missing", param),
                errNo,
            )
        }
    }

    return nil
}