Skip to content

Commit

Permalink
Merge pull request #74 from detiber/noTokenCompletion
Browse files Browse the repository at this point in the history
Do not require token for completions subcommand
  • Loading branch information
displague authored Aug 12, 2020
2 parents 8dd01cf + 7a9ae27 commit dd3619b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ var completionCmd = &cobra.Command{
// ValidArgs make this error response dead-code
return fmt.Errorf("unknown shell: %q", args[0])
},
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return nil
},
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func initConfig() {
viper.AddConfigPath(userHomeDir())
}

if err := viper.ReadInConfig(); err != nil {
if err := viper.ReadInConfig(); err != nil && !errors.As(err, &viper.ConfigFileNotFoundError{}) {
panic(fmt.Errorf("Could not read config: %s", err))
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/mattn/go-runewidth v0.0.2 // indirect
github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84
github.com/packethost/packngo v0.2.0
github.com/pkg/errors v0.8.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.4.0
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
Expand Down

0 comments on commit dd3619b

Please sign in to comment.