-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [#] switch code gen from cli to go-flags
- Loading branch information
Showing
2 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,47 @@ | ||
# program name, name for the executable | ||
ProgramName: cc2py | ||
Authors: Tong Sun | ||
|
||
PackageName: main | ||
|
||
Name: cc2pyC | ||
Desc: Chinese-Character to Pinyin converter | ||
Text: Converter Chinese to pinyin in different ways | ||
#NumArg: cli.AtLeast(1) | ||
#NumOption: cli.AtLeast(3) | ||
CanSubRoute: true | ||
|
||
Options: | ||
- Name: Filei | ||
Type: '*clix.Reader' | ||
Type: string | ||
Flag: "i,in" | ||
Usage: 'the Chinese text file to read from (or stdin)\n\t\t\tif not specified, read from command line instead' | ||
|
||
- Name: Tone | ||
Type: int | ||
Flag: 't,tone' | ||
EnvV: true | ||
Usage: 'tone selection\n\t\t\t 0: normal. mnemonic~ nothing\n\t\t\t 1: tone at the end. mnemonic~ single sided\n\t\t\t 2: tone after yunmu. mnemonic~ double sided\n\t\t\t 3: tone on yunmu. mnemonic~ fancy' | ||
|
||
- Name: Truncate | ||
Type: int | ||
Flag: 'l,truncate' | ||
EnvV: true | ||
Usage: 'select only part of the pinyin\n\t\t\t 0: normal. mnemonic~ nothing truncated\n\t\t\t 1: leave first char. mnemonic~ one\n\t\t\t 2: leave first shengmu. mnemonic~ might be two\n\t\t\t 9: leave only yunmu. mnemonic~ last' | ||
|
||
- Name: Separator | ||
Type: string | ||
Flag: s,separator | ||
EnvV: true | ||
Usage: separator string between each pinyin | ||
Value: " " | ||
|
||
- Name: Polyphone | ||
Type: bool | ||
Flag: p,polyphone | ||
EnvV: true | ||
Usage: polyphone support, output each polyphone pinyin available | ||
|
||
- Name: Capital | ||
Type: bool | ||
Flag: c,capitalized | ||
EnvV: true | ||
Usage: capitalized each pinyin word | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
easygen -tf ../../suntong/cli/cli-tx cc2py | gofmt > cc2pyCLIDef.go | ||
pwd=`pwd` | ||
cd $GOPATH/src/github.com/go-easygen/easygen/test | ||
easygen commandlineGoFlags.header,commandlineGoFlags.ityped.tmpl,commandlineGoFlags "$pwd/cc2py"_cli | gofmt > "$pwd/cc2py"_cliDef.go |