Skip to content

Commit

Permalink
Add short flags: -f, -s, -p, -e, -m.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdscxsj committed Oct 23, 2017
1 parent 328ca43 commit 7815525
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pypinyin/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ def get_parser():
parser.add_argument('-V', '--version', action='version',
version='{0} {1}'.format(__title__, __version__))
# 要执行的函数名称
parser.add_argument('--func', help='function name (default: "pinyin")',
parser.add_argument('-f', '--func', help='function name (default: "pinyin")',
choices=['pinyin', 'slug'],
default='pinyin')
# 拼音风格
parser.add_argument('--style', help='pinyin style (default: "TONE")',
parser.add_argument('-s', '--style', help='pinyin style (default: "TONE")',
choices=['NORMAL', 'TONE', 'TONE2', 'TONE3',
'INITIALS', 'FIRST_LETTER', 'FINALS',
'FINALS_TONE', 'FINALS_TONE2', 'FINALS_TONE3',
'BOPOMOFO', 'BOPOMOFO_FIRST',
'CYRILLIC', 'CYRILLIC_FIRST'], default='TONE')
parser.add_argument('--separator', help='slug separator (default: "-")',
parser.add_argument('-p', '--separator', help='slug separator (default: "-")',
default='-')
parser.add_argument('--errors', help=('how to handle none-pinyin string '
parser.add_argument('-e', '--errors', help=('how to handle none-pinyin string '
'(default: "default")'),
choices=['default', 'ignore', 'replace'],
default='default')
# 输出多音字
parser.add_argument('--heteronym', help='enable heteronym',
parser.add_argument('-m', '--heteronym', help='enable heteronym',
action='store_true')
# 要查询的汉字
parser.add_argument('hans', help='chinese string')
Expand Down

0 comments on commit 7815525

Please sign in to comment.