Skip to content

Commit 78deea6

Browse files
committed
Add argument to print the current version
1 parent f0c9fe5 commit 78deea6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ fi
9595

9696
## Options
9797

98+
- **-v**: Show the current version
9899
- **-app**: Application name
99100
- **-output**: Output directory (default `.`)
100101
- **-yml**: Compose file path (default `docker-compose.yml`)

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ func saveToBash(services map[string]Service) (err error) {
175175
}
176176

177177
func main() {
178+
version := flag.Bool("v", false, "show the current version")
178179
flag.StringVar(&appName, "app", "", "application name")
179180
flag.StringVar(&composePath, "yml", "docker-compose.yml", "compose file path")
180181
flag.StringVar(&outputPath, "output", ".", "output directory")
@@ -183,6 +184,11 @@ func main() {
183184

184185
flag.Parse()
185186

187+
if *version {
188+
fmt.Println("compose2bash version 1.3.0")
189+
return
190+
}
191+
186192
if appName == "" {
187193
fmt.Println("Missing app argument")
188194
os.Exit(1)

0 commit comments

Comments
 (0)