Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change flag for config file to "-c,--config" #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN apk -U add --virtual .build_deps \
git make && \

go get -u github.com/kardianos/govendor && \
go get -u github.com/spf13/pflag && \
make exe && \

mv _build/relay /usr/local/bin && \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ RUN apt-get update && \
git \
golang-go=$GO_PACKAGE_VERSION

RUN go get -u github.com/kardianos/govendor
RUN go get -u github.com/golang/lint/golint
RUN go get -u github.com/kardianos/govendor
RUN go get -u github.com/spf13/pflag

WORKDIR /gopath/src/github.com/operable/go-relay
COPY . /gopath/src/github.com/operable/go-relay
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM operable/go:1.6.3
ENV PATH=${GOPATH}/bin:${PATH}
# Add goveralls for sending stats to coveralls.io in Travis CI
RUN go get github.com/mattn/goveralls
RUN go get github.com/spf13/pflag

COPY . $GOPATH/src/github.com/operable/go-relay
WORKDIR $GOPATH/src/github.com/operable/go-relay
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"
"os"
"os/signal"
Expand All @@ -12,6 +11,7 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/operable/go-relay/relay"
"github.com/operable/go-relay/relay/config"
flag "github.com/spf13/pflag"
)

const (
Expand All @@ -20,10 +20,10 @@ const (
BUS_ERR
)

var configFile = flag.String("file", "", "Path to configuration file")
var configFile = flag.StringP("config", "c", "", "Path to configuration file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep compatibility and deprecate out --file with a warning instead of a breaking change?

var cpuprofile = flag.String("cpuprofile", "", "Write CPU profile to file")
var memprofile = flag.String("memprofile", "", "Write memory profile to this file")
var devMode = flag.Bool("dev", false, "Enable developer mode")
var devMode = flag.Bool("dev", false, "Enable developer mode")

// Populated by build script
var buildstamp string
Expand Down Expand Up @@ -70,7 +70,7 @@ func configureLogger(config *config.Config) {
case "stdout":
log.SetOutput(os.Stdout)
default:
logFile, err := os.OpenFile(config.LogPath, os.O_WRONLY | os.O_APPEND | os.O_CREATE, 0644)
logFile, err := os.OpenFile(config.LogPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
if err != nil {
panic(err)
}
Expand Down