feat: version

This commit is contained in:
CDN18 2024-08-11 12:20:05 +08:00
parent 1b1862cb3f
commit 45e42ce4ff
Signed by: CDN
GPG key ID: 0C656827F9F80080
2 changed files with 15 additions and 10 deletions

View file

@ -18,6 +18,8 @@ func main() {
convertLyrics(os.Args[2:]) convertLyrics(os.Args[2:])
case "fmt": case "fmt":
fmtLyrics(os.Args[2:]) fmtLyrics(os.Args[2:])
case "version":
fmt.Printf("lyc-cli version %s\n", VERSION)
case "help": case "help":
fmt.Println(USAGE) fmt.Println(USAGE)
default: default:

View file

@ -6,14 +6,17 @@ type Lyrics struct {
Content []string Content []string
} }
const USAGE = `Usage: lyc-cli [command] [options] const (
Commands: VERSION = "0.2.0"
sync Synchronize timeline of two lyrics files USAGE = `Usage: lyc-cli [command] [options]
convert Convert lyrics file to another format Commands:
help Show help` sync Synchronize timeline of two lyrics files
convert Convert lyrics file to another format
help Show help`
const SYNC_USAGE = `Usage: lyc-cli sync <source> <target>` SYNC_USAGE = `Usage: lyc-cli sync <source> <target>`
const CONVERT_USAGE = `Usage: lyc-cli convert <source> <target> CONVERT_USAGE = `Usage: lyc-cli convert <source> <target>
Note: Note:
Target format is determined by file extension. Supported formats: Target format is determined by file extension. Supported formats:
.txt Plain text format(No meta/timeline tags)` .txt Plain text format(No meta/timeline tags)`
)