From 45e42ce4ff988cb5ad0df6d06e5fede3dfb0c229 Mon Sep 17 00:00:00 2001 From: CDN18 Date: Sun, 11 Aug 2024 12:20:05 +0800 Subject: [PATCH] feat: version --- main.go | 2 ++ model.go | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index dfe9011..05f0f94 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,8 @@ func main() { convertLyrics(os.Args[2:]) case "fmt": fmtLyrics(os.Args[2:]) + case "version": + fmt.Printf("lyc-cli version %s\n", VERSION) case "help": fmt.Println(USAGE) default: diff --git a/model.go b/model.go index ddfd833..c9a7c94 100644 --- a/model.go +++ b/model.go @@ -6,14 +6,17 @@ type Lyrics struct { Content []string } -const USAGE = `Usage: lyc-cli [command] [options] -Commands: - sync Synchronize timeline of two lyrics files - convert Convert lyrics file to another format - help Show help` +const ( + VERSION = "0.2.0" + USAGE = `Usage: lyc-cli [command] [options] + Commands: + sync Synchronize timeline of two lyrics files + convert Convert lyrics file to another format + help Show help` -const SYNC_USAGE = `Usage: lyc-cli sync ` -const CONVERT_USAGE = `Usage: lyc-cli convert -Note: -Target format is determined by file extension. Supported formats: - .txt Plain text format(No meta/timeline tags)` + SYNC_USAGE = `Usage: lyc-cli sync ` + CONVERT_USAGE = `Usage: lyc-cli convert + Note: + Target format is determined by file extension. Supported formats: + .txt Plain text format(No meta/timeline tags)` +)