File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 0.1.1] - 2026-01-06
9+ ### Added
10+ - ` --version ` / ` -v ` flag to display version information.
11+
812## [ 0.1.0] - 2026-01-06
913
1014### Added
Original file line number Diff line number Diff line change 22
33# gsw: Google Switch
44# Easily switch between gcloud configurations
5+ GSW_VERSION=" v0.1.1"
6+
57function gsw() {
8+ if [ " $1 " = " --version" ] || [ " $1 " = " -v" ]; then
9+ echo " gsw version $GSW_VERSION "
10+ return 0
11+ fi
12+
613 if [ -z " $1 " ]; then
714 echo " Available gcloud configurations:"
815 gcloud config configurations list
916 echo " "
1017 echo " Usage: gsw <config_name>"
18+ echo " gsw --version"
1119 echo " Switches the GLOBAL active configuration."
1220 echo " "
1321 echo " 💡 Tip: To switch automatically when entering a directory,"
Original file line number Diff line number Diff line change @@ -42,3 +42,10 @@ setup() {
4242 [ " $status " -eq 0 ]
4343 [[ " $output " =~ " Usage: gsw" ]]
4444}
45+
46+ @test " gsw --version outputs version" {
47+ run gsw --version
48+ [ " $status " -eq 0 ]
49+ # Check format: gsw version vX.X.X
50+ [[ " $output " =~ " gsw version v" [0-9]+\. [0-9]+\. [0-9]+ ]]
51+ }
You can’t perform that action at this time.
0 commit comments