Skip to content

Commit

Permalink
logpasta version
Browse files Browse the repository at this point in the history
  • Loading branch information
ripexz committed May 6, 2019
1 parent 84baa87 commit 120cff1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_Store
vendor
logpasta
logpasta
*-windows-*
*-darwin-*
*-linux-*
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Simple CLI for [Logpasta](https://www.logpasta.com), just run `your_command | lo
- `any_command | logpasta [flags]`
- `logpasta [flags] any string at all`

To see the current CLI version, run `logpasta version`

### Config

You can override the default configuration by passing flags:
Expand Down
10 changes: 9 additions & 1 deletion logpasta.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ import (
"time"
)

var baseURL = "https://www.logpasta.com"
var (
baseURL = "https://www.logpasta.com"
version = "v0.1.0"
)

func main() {
if len(os.Args) > 1 && os.Args[1] == "version" {
log.Printf("Logpasta CLI %s", version)
return
}

log.SetPrefix("[logpasta] ")

// load config from env then from flags
Expand Down

0 comments on commit 120cff1

Please sign in to comment.