From 489744f7a62c7e94ba5d5c670168a2d718a65288 Mon Sep 17 00:00:00 2001 From: hatsu38 Date: Sun, 22 Aug 2021 18:18:10 +0900 Subject: [PATCH 1/3] Add version flag --- .github/workflows/test.yml | 3 --- main.go | 36 ++++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 21d2e23..b0dbae1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,6 @@ name: Test on: pull_request: - push: - branches: - - main jobs: test: diff --git a/main.go b/main.go index 6f8e56d..a163dce 100644 --- a/main.go +++ b/main.go @@ -16,18 +16,22 @@ var ( func usage() { format := ` - _ _ _ - _ __ ___ ___| |_ _ __ ___ __ _ _ __ | |_ _ _(_) - | '_ \ / _ \/ __| __| '_ ' _ \ / _' | '_ \ _____| __| | | | | - | |_) | (_) \__ \ |_| | | | | | (_| | | | |_____| |_| |_| | | - | .__/ \___/|___/\__|_| |_| |_|\__,_|_| |_| \__|\__,_|_| - |_| Version: %s-%s - - Usage: - postman-tui - Author: - hatsu38 - ` + _ _ _ +_ __ ___ ___| |_ _ __ ___ __ _ _ __ | |_ _ _(_) +| '_ \ / _ \/ __| __| '_ ' _ \ / _' | '_ \ _____| __| | | | | +| |_) | (_) \__ \ |_| | | | | | (_| | | | |_____| |_| |_| | | +| .__/ \___/|___/\__|_| |_| |_|\__,_|_| |_| \__|\__,_|_| +|_| Version: %s-%s + +Usage: + postman-tui + + Flags: + -version: Print the current version + +Author: + hatsu38 +` fmt.Fprintln(os.Stderr, fmt.Sprintf(format, Version, Revision)) } @@ -41,8 +45,16 @@ func run() int { } func main() { + var withVersion bool + flag.BoolVar(&withVersion, "version", false, "Print the current version") + flag.Usage = usage flag.Parse() + if withVersion { + fmt.Println("Version ", Version) + return + } + run() } From 2405558ab9b55cd41e490d6303e15c738e22acb9 Mon Sep 17 00:00:00 2001 From: hatsu38 Date: Sun, 22 Aug 2021 18:26:55 +0900 Subject: [PATCH 2/3] fix aa --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index a163dce..1c312ca 100644 --- a/main.go +++ b/main.go @@ -15,9 +15,9 @@ var ( ) func usage() { - format := ` - _ _ _ -_ __ ___ ___| |_ _ __ ___ __ _ _ __ | |_ _ _(_) + format := +` _ _ _ +_ __ ___ ___| |_ _ __ ___ __ _ _ __ | |_ _ _(_) | '_ \ / _ \/ __| __| '_ ' _ \ / _' | '_ \ _____| __| | | | | | |_) | (_) \__ \ |_| | | | | | (_| | | | |_____| |_| |_| | | | .__/ \___/|___/\__|_| |_| |_|\__,_|_| |_| \__|\__,_|_| From 689a140443592179558d6de295b5df1dcf0e3688 Mon Sep 17 00:00:00 2001 From: hatsu Date: Sun, 22 Aug 2021 18:28:12 +0900 Subject: [PATCH 3/3] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b1617d4..e12d868 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ https://user-images.githubusercontent.com/16137809/129535113-e5c9447a-0171-4056- brew install hatsu38/postman-tui/postman-tui ``` +usage postman-tui + + ## Lint ```sh @@ -46,4 +49,4 @@ If you have any concerns, please contact us at ↓. https://twitter.com/hatsu_38 ## License -This code is free to use under the terms of the MIT license. \ No newline at end of file +This code is free to use under the terms of the MIT license.