Skip to content

Commit

Permalink
Replace flag with pflag
Browse files Browse the repository at this point in the history
Allows us to make use of flags that are prefixed with --. The flag
package did not.
  • Loading branch information
ollien committed Aug 12, 2017
1 parent 5921d31 commit 8ab10c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
Expand All @@ -12,6 +11,7 @@ import (

"github.com/digitalocean/godo"
"github.com/logrusorgru/aurora"
"github.com/ogier/pflag"

"golang.org/x/oauth2"
)
Expand Down Expand Up @@ -154,9 +154,9 @@ func CreateOrUpdateRecord(config *Config, domainService godo.DomainsService) (DN
}

func main() {
configPath := flag.String("-config", defaultConfigPath, "Set a path to a config.json")
silent := flag.Bool("-silent", false, "Disable all output to stdout")
flag.Parse()
configPath := pflag.String("config", defaultConfigPath, "Set a path to a config.json")
silent := pflag.Bool("silent", false, "Disable all output to stdout")
pflag.Parse()

config, err := NewConfig(*configPath)
if err != nil {
Expand Down

0 comments on commit 8ab10c7

Please sign in to comment.