diff --git a/.gitignore b/.gitignore index fcd4cdb..3b344cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .DS_Store vendor -logpasta \ No newline at end of file +logpasta +*-windows-* +*-darwin-* +*-linux-* \ No newline at end of file diff --git a/README.md b/README.md index 0f10989..55c6279 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/logpasta.go b/logpasta.go index 59f95ae..ed35c7a 100644 --- a/logpasta.go +++ b/logpasta.go @@ -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