Skip to content

Commit 8aad250

Browse files
committed
add terse option for version command
1 parent ccba6c8 commit 8aad250

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Sources/CodeEditCLI/Version.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@ extension CodeEditCLI {
1515
abstract: "Prints the version of the CLI and CodeEdit.app."
1616
)
1717

18+
@Flag(name: .shortAndLong, help: "Only prints the version number of the CLI")
19+
var terse = false
20+
1821
func run() throws {
22+
// if terse flag is set only print the cli version number
23+
if terse {
24+
print(CLI_VERSION)
25+
return
26+
}
27+
1928
// Print the cli version
2029
print("CodeEditCLI: \t\(CLI_VERSION)")
2130

Sources/CodeEditCLI/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
// ##################################################
1212
// This needs to be changed prior to every release!
1313
// ##################################################
14-
let CLI_VERSION = "0.0.8"
14+
let CLI_VERSION = "0.0.9"
1515

1616
struct CodeEditCLI: ParsableCommand {
1717
static let configuration = CommandConfiguration(

0 commit comments

Comments
 (0)