Skip to content

Commit 2c04c28

Browse files
committed
Improve usability of transliteration CLI command.
1 parent 031eb4b commit 2c04c28

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ the drop-down automatically. The value must be one of the keys found in
114114
## Command-line interface
115115

116116
Various Scriptshifter commands can be accessed via the shell command `sscli`.
117-
At the moment only a few essential admin and testing tools are available. More
118-
commands can be made avaliable on an as-needed basis.
117+
At the moment a few essential admin and testing tools are available, as well as
118+
a transliteration function. More commands can be made available on an as-needed
119+
basis.
119120

120121
Help menu:
121122

@@ -129,6 +130,12 @@ Section help:
129130
/path/to/sscli admin --help
130131
```
131132

133+
Transliteration:
134+
135+
```
136+
echo "王正强" | /path/to/sscli trans chinese -c first -o "marc_field=100"
137+
```
138+
132139

133140
## Contributing
134141

sscli

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,9 @@ def samples(lang):
6565
return test_sample(lang)
6666

6767

68-
@cli.group(name="trans")
69-
def trans_grp():
70-
""" Transliteration and transcription operations. """
71-
pass
72-
73-
74-
@trans_grp.command()
75-
@click.argument("src", type=click.File("r"))
68+
@cli.command(name="trans")
7669
@click.argument("lang")
70+
@click.argument("src", type=click.File("r"), default="-")
7771
@click.option(
7872
"-c", "--capitalize", default=None,
7973
help="Capitalize output: `first`, `all`, ot none (the default).")
@@ -85,12 +79,11 @@ def trans_grp():
8579
help=(
8680
"Language=specific option. Format: key=value. Multiple -o entries "
8781
"are possible."))
88-
def transliterate(src, lang, t_dir, capitalize, option):
82+
def trans_(src, lang, t_dir, capitalize, option):
8983
"""
9084
Transliterate text from standard input.
9185
92-
e.g.: `echo "王正强" | /path/to/sscli trans transliterate chinese
93-
-o "marc_field=100"'
86+
e.g.: `echo "王正强" | /path/to/sscli trans chinese -o "marc_field=100"'
9487
"""
9588
options = {}
9689
for opt in option:

0 commit comments

Comments
 (0)