Skip to content

Commit

Permalink
Avoid exporting commands, not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerBrock committed Jun 30, 2018
1 parent c867c89 commit 971d958
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var getConfig config.Configuration

var GetCommand = &cobra.Command{
var getCommand = &cobra.Command{
Use: "get <log group>",
Short: "Get log events",
Long: "",
Expand All @@ -39,16 +39,16 @@ var GetCommand = &cobra.Command{
}

func init() {
GetCommand.Flags().StringVar(&getConfig.Prefix, "prefix", "", "log group prefix filter")
GetCommand.Flags().StringVar(
getCommand.Flags().StringVar(&getConfig.Prefix, "prefix", "", "log group prefix filter")
getCommand.Flags().StringVar(
&getConfig.Start,
"start",
"",
`start getting the logs from this point
Takes an absolute timestamp in RFC3339 format, or a relative time (eg. -2h).
Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".`,
)
GetCommand.Flags().StringVar(
getCommand.Flags().StringVar(
&getConfig.End,
"stop",
"now",
Expand Down
4 changes: 2 additions & 2 deletions cmd/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// TODO: colorize based on logGroup prefix (/aws/lambda, /aws/kinesisfirehose, etc...)
var groupsConfig config.Configuration

var GroupsCommand = &cobra.Command{
var groupsCommand = &cobra.Command{
Use: "groups",
Short: "List log groups",
Long: "",
Expand All @@ -25,5 +25,5 @@ var GroupsCommand = &cobra.Command{
}

func init() {
GroupsCommand.Flags().StringVar(&groupsConfig.Prefix, "prefix", "", "log group prefix filter")
groupsCommand.Flags().StringVar(&groupsConfig.Prefix, "prefix", "", "log group prefix filter")
}
16 changes: 8 additions & 8 deletions cmd/saw.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/spf13/cobra"
)

var SawCommand = &cobra.Command{
var sawCommand = &cobra.Command{
Use: "saw <command>",
Short: "A fast, multipurpose tool for AWS CloudWatch Logs",
Long: "Saw is a fast, multipurpose tool for cutting through AWS CloudWatch Logs.",
Expand All @@ -21,11 +21,11 @@ var SawCommand = &cobra.Command{
var awsConfig config.AWSConfiguration

func init() {
SawCommand.AddCommand(GroupsCommand)
SawCommand.AddCommand(StreamsCommand)
SawCommand.AddCommand(VersionCommand)
SawCommand.AddCommand(WatchCommand)
SawCommand.AddCommand(GetCommand)
SawCommand.PersistentFlags().StringVar(&awsConfig.Region, "region", "", "override profile AWS region")
SawCommand.PersistentFlags().StringVar(&awsConfig.Profile, "profile", "", "override default AWS profile")
sawCommand.AddCommand(groupsCommand)
sawCommand.AddCommand(streamsCommand)
sawCommand.AddCommand(versionCommand)
sawCommand.AddCommand(watchCommand)
sawCommand.AddCommand(getCommand)
sawCommand.PersistentFlags().StringVar(&awsConfig.Region, "region", "", "override profile AWS region")
sawCommand.PersistentFlags().StringVar(&awsConfig.Profile, "profile", "", "override default AWS profile")
}
8 changes: 4 additions & 4 deletions cmd/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

var streamsConfig config.Configuration

var StreamsCommand = &cobra.Command{
var streamsCommand = &cobra.Command{
Use: "streams <log group>",
Short: "List streams in log group",
Long: "",
Expand All @@ -33,7 +33,7 @@ var StreamsCommand = &cobra.Command{
}

func init() {
StreamsCommand.Flags().StringVar(&streamsConfig.Prefix, "prefix", "", "stream prefix filter")
StreamsCommand.Flags().StringVar(&streamsConfig.OrderBy, "orderBy", "LogStreamName", "order streams by LogStreamName or LastEventTime")
StreamsCommand.Flags().BoolVar(&streamsConfig.Descending, "descending", false, "order streams descending")
streamsCommand.Flags().StringVar(&streamsConfig.Prefix, "prefix", "", "stream prefix filter")
streamsCommand.Flags().StringVar(&streamsConfig.OrderBy, "orderBy", "LogStreamName", "order streams by LogStreamName or LastEventTime")
streamsCommand.Flags().BoolVar(&streamsConfig.Descending, "descending", false, "order streams descending")
}
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

const version = "0.1.6"

var VersionCommand = &cobra.Command{
var versionCommand = &cobra.Command{
Use: "version",
Short: "Prints the version string",
Long: "",
Expand Down
10 changes: 5 additions & 5 deletions cmd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ var WatchCommand = &cobra.Command{
}

func init() {
WatchCommand.Flags().StringVar(&watchConfig.Prefix, "prefix", "", "log stream prefix filter")
WatchCommand.Flags().StringVar(&watchConfig.Filter, "filter", "", "event filter pattern")
WatchCommand.Flags().BoolVar(&outputConfig.Expand, "expand", false, "indent JSON log messages")
WatchCommand.Flags().BoolVar(&outputConfig.Invert, "invert", false, "invert colors for light terminal themes")
WatchCommand.Flags().BoolVar(&outputConfig.RawString, "rawString", false, "print JSON strings without escaping")
watchCommand.Flags().StringVar(&watchConfig.Prefix, "prefix", "", "log stream prefix filter")
watchCommand.Flags().StringVar(&watchConfig.Filter, "filter", "", "event filter pattern")
watchCommand.Flags().BoolVar(&outputConfig.Expand, "expand", false, "indent JSON log messages")
watchCommand.Flags().BoolVar(&outputConfig.Invert, "invert", false, "invert colors for light terminal themes")
watchCommand.Flags().BoolVar(&outputConfig.RawString, "rawString", false, "print JSON strings without escaping")
}

0 comments on commit 971d958

Please sign in to comment.