Skip to content
Permalink
Browse files

add hidden disable stats command (#659)

As discussed on Slack, I'm unable to send anonymized usage
stats for various reasons. This patch makes disabling the
stats much easier, as no prior knowledge of `go-cli-analytics`
is required.
  • Loading branch information...
stephenmathieson authored and tj committed May 14, 2018
1 parent 7b607bf commit b1d5f35336b9914ad5b8296224e2f2e4f47e9665
Showing with 21 additions and 0 deletions.
  1. +1 −0 cmd/up/main.go
  2. +20 −0 internal/cli/disable-stats/disable-stats.go
@@ -13,6 +13,7 @@ import (
_ "github.com/apex/up/internal/cli/build"
_ "github.com/apex/up/internal/cli/config"
_ "github.com/apex/up/internal/cli/deploy"
_ "github.com/apex/up/internal/cli/disable-stats"
_ "github.com/apex/up/internal/cli/docs"
_ "github.com/apex/up/internal/cli/domains"
_ "github.com/apex/up/internal/cli/logs"
@@ -0,0 +1,20 @@
package disablestats

import (
"github.com/pkg/errors"
"github.com/tj/kingpin"

"github.com/apex/up/internal/cli/root"
"github.com/apex/up/internal/stats"
)

func init() {
cmd := root.Command("disable-stats", "Disable anonymized usage stats").Hidden()
cmd.Action(func(_ *kingpin.ParseContext) error {
err := stats.Client.Disable()
if err != nil {
return errors.Wrap(err, "disabling")
}
return nil
})
}

0 comments on commit b1d5f35

Please sign in to comment.
You can’t perform that action at this time.