From 1d12defec5699eabcb959370e566060dc1b53b82 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Apr 2023 08:56:08 +0200 Subject: [PATCH] Add version and make them consistent Preparation for release 0.7. --- cmd/pasta/pasta.go | 6 ++++++ cmd/pastad/pastad.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/pasta/pasta.go b/cmd/pasta/pasta.go index bd4bfb1..2fb994e 100644 --- a/cmd/pasta/pasta.go +++ b/cmd/pasta/pasta.go @@ -17,6 +17,8 @@ import ( "github.com/BurntSushi/toml" ) +const VERSION = "0.7" + type Config struct { RemoteHost string `toml:"RemoteHost"` RemoteHosts []RemoteHost `toml:"Remote"` @@ -73,6 +75,7 @@ func usage() { fmt.Println("") fmt.Println(" --ls, --list List known pasta pushes") fmt.Println(" --gc Garbage collector (clean expired pastas)") + fmt.Println(" --version Show client version") fmt.Println("") fmt.Println("One or more files can be pushed to the server.") fmt.Println("If no file is given, the input from stdin will be pushed.") @@ -196,6 +199,9 @@ func main() { action = "rm" } else if arg == "--gc" { action = "gc" + } else if arg == "--version" { + fmt.Printf("pasta version %s\n", VERSION) + os.Exit(1) } else if arg == "--" { // The rest are filenames if i+1 < len(args) { diff --git a/cmd/pastad/pastad.go b/cmd/pastad/pastad.go index f87de4f..5f5d8f9 100644 --- a/cmd/pastad/pastad.go +++ b/cmd/pastad/pastad.go @@ -21,7 +21,7 @@ import ( "github.com/akamensky/argparse" ) -const VERSION = "0.2" +const VERSION = "0.7" var cf Config var bowl PastaBowl