Skip to content

Commit

Permalink
Add man pages (man cw)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucagrulla committed Aug 16, 2018
1 parent abfbe94 commit cf6cdb0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@ brew:
system bin/"cw --completion-script-bash > cw.bash"
bash_completion.install "cw.bash"
system bin/"cw --help-man > cw.1"
man1.install "cw.1"
# system bin/"cw completion zsh > cw.zsh"
# zsh_completion.install "cw.zsh"
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ import (
)

var (
lsCommand = kingpin.Command("ls", "Show an entity")
version = "1.6.0"
kp = kingpin.New("cw", "The best way to tail AWS Cloudwatch Logs from your terminal.")

lsCommand = kp.Command("ls", "Show an entity")
lsGroups = lsCommand.Command("groups", "Show all groups.")
lsStreams = lsCommand.Command("streams", "Show all streams in a given log group.")
lsLogGroupName = lsStreams.Arg("group", "the group name").HintAction(groupsCompletion).Required().String()

tailCommand = kingpin.Command("tail", "Tail a log group.")
tailCommand = kp.Command("tail", "Tail a log group.")

follow = tailCommand.Flag("follow", "Don't stop when the end of stream is reached, but rather wait for additional data to be appended.").Short('f').Default("false").Bool()
printTimestamp = tailCommand.Flag("timestamp", "Print the event timestamp.").Short('t').Default("false").Bool()
Expand Down Expand Up @@ -115,15 +118,12 @@ func versionCheckOnSigterm(version string, latestVersionChannel chan string) {
}

func main() {
version := "1.6.0"
kingpin.Version(version).Author("Luca Grulla")
command := kingpin.Parse()

kp.Version(version).Author("Luca Grulla")
latestVersionChannel := fetchLatestVersion()

versionCheckOnSigterm(version, latestVersionChannel)

switch command {
switch kingpin.MustParse(kp.Parse(os.Args[1:])) {
case "ls groups":
for msg := range cloudwatch.LsGroups() {
fmt.Println(*msg)
Expand Down

0 comments on commit cf6cdb0

Please sign in to comment.