Skip to content

Commit 07d1026

Browse files
committed
- [#] manually update wireframe options to main
1 parent 0345528 commit 07d1026

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

cc2py_main.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727

2828
var (
2929
progname = "cc2py"
30-
version = "0.2.2"
31-
date = "2022-01-18"
30+
version = "0.2.3"
31+
date = "2022-01-22"
3232

3333
// Opts store all the configurable options
3434
Opts OptsT
@@ -41,6 +41,11 @@ var parser = flags.NewParser(&Opts, flags.Default)
4141

4242
// Function main
4343
func main() {
44+
Opts.Version = showVersion
45+
Opts.Verbflg = func() {
46+
Opts.Verbose++
47+
}
48+
4449
if _, err := parser.Parse(); err != nil {
4550
parser.WriteHelp(os.Stdout)
4651
os.Exit(1)
@@ -106,6 +111,14 @@ func cc2py(dd string, tone, truncate int, separator string, polyphone, capitaliz
106111
//==========================================================================
107112
// support functions
108113

114+
func showVersion() {
115+
fmt.Fprintf(os.Stderr, "cc2py - Chinese-Character to Pinyin converter\n")
116+
fmt.Fprintf(os.Stderr, "Copyright (C) 2022, Tong Sun\n\n")
117+
fmt.Fprintf(os.Stderr, "Converter Chinese to pinyin in different ways\n\nBuilt on %s\nVersion %s\n",
118+
date, version)
119+
os.Exit(0)
120+
}
121+
109122
// abortOn will quit on anticipated errors gracefully without stack trace
110123
func abortOn(errCase string, e error) {
111124
if e != nil {

0 commit comments

Comments
 (0)