-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from hatsu38/featurer/add-flag-version
Add version flag
- Loading branch information
Showing
3 changed files
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,6 @@ name: Test | |
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,19 +15,23 @@ var ( | |
) | ||
|
||
func usage() { | ||
format := ` | ||
_ _ _ | ||
_ __ ___ ___| |_ _ __ ___ __ _ _ __ | |_ _ _(_) | ||
| '_ \ / _ \/ __| __| '_ ' _ \ / _' | '_ \ _____| __| | | | | | ||
| |_) | (_) \__ \ |_| | | | | | (_| | | | |_____| |_| |_| | | | ||
| .__/ \___/|___/\__|_| |_| |_|\__,_|_| |_| \__|\__,_|_| | ||
|_| Version: %s-%s | ||
Usage: | ||
postman-tui | ||
Author: | ||
hatsu38<[email protected]> | ||
` | ||
format := | ||
` _ _ _ | ||
_ __ ___ ___| |_ _ __ ___ __ _ _ __ | |_ _ _(_) | ||
| '_ \ / _ \/ __| __| '_ ' _ \ / _' | '_ \ _____| __| | | | | | ||
| |_) | (_) \__ \ |_| | | | | | (_| | | | |_____| |_| |_| | | | ||
| .__/ \___/|___/\__|_| |_| |_|\__,_|_| |_| \__|\__,_|_| | ||
|_| Version: %s-%s | ||
Usage: | ||
postman-tui | ||
Flags: | ||
-version: Print the current version | ||
Author: | ||
hatsu38<[email protected]> | ||
` | ||
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() | ||
} |