Mercurial > babel > mirror
annotate doc/cmdline.txt @ 73:9bc73c0bf7e5 trunk
Extended the docs a bit.
author | cmlenz |
---|---|
date | Fri, 08 Jun 2007 21:40:44 +0000 |
parents | 6b9c32893007 |
children | c75fa55a65b9 |
rev | line source |
---|---|
2 | 1 .. -*- mode: rst; encoding: utf-8 -*- |
2 | |
3 ====================== | |
4 Command-Line Interface | |
5 ====================== | |
6 | |
7 Babel includes a command-line interface for working with message catalogs, | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
8 similar to the various GNU ``gettext`` tools commonly available on Linux/Unix |
2 | 9 systems. |
10 | |
11 | |
12 .. contents:: Contents | |
13 :depth: 2 | |
14 .. sectnum:: | |
15 | |
16 | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
17 When properly installed, Babel provides a script called ``babel``:: |
2 | 18 |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
19 $ babel --help |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
20 usage: babel subcommand [options] [args] |
2 | 21 |
22 options: | |
23 --version show program's version number and exit | |
24 -h, --help show this help message and exit | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
25 |
73 | 26 subcommands: |
27 extract extract messages from source files and generate a POT file | |
28 init create new message catalogs from a template | |
29 | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
30 The ``babel`` script provides a number of sub-commands that do the actual work. |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
31 Those sub-commands are described below. |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
32 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
33 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
34 extract |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
35 ======= |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
36 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
37 The ``extract`` sub-command can be used to extract localizable messages from |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
38 a collection of source files:: |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
39 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
40 $ babel extract --help |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
41 usage: babel extract [options] dir1 <dir2> ... |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
42 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
43 options: |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
44 -h, --help show this help message and exit |
2 | 45 --charset=CHARSET charset to use in the output |
46 -k KEYWORDS, --keyword=KEYWORDS | |
47 keywords to look for in addition to the defaults. You | |
48 can specify multiple -k flags on the command line. | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
49 --no-default-keywords |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
50 do not include the default keywords |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
51 -F MAPPING_FILE, --mapping=MAPPING_FILE |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
52 path to the extraction mapping file |
2 | 53 --no-location do not include location comments with filename and |
54 line number | |
55 --omit-header do not include msgid "" entry in header | |
56 -o OUTPUT, --output=OUTPUT | |
57 path to the output POT file | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
58 -w WIDTH, --width=WIDTH |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
59 set output line width (default 76) |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
60 --no-wrap do not break long message lines, longer than the |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
61 output line width, into several lines |
73 | 62 |
63 | |
64 init | |
65 ==== | |
66 | |
67 The `init` sub-command creates a new translations catalog based on a PO | |
68 template file:: | |
69 | |
70 $ babel init --help | |
71 usage: babel init [options] | |
72 | |
73 create new message catalogs from a template | |
74 | |
75 options: | |
76 -h, --help show this help message and exit | |
77 -D DOMAIN, --domain=DOMAIN | |
78 domain of PO file (defaults to lower-cased project | |
79 name) | |
80 -i INPUT_FILE, --input-file=INPUT_FILE | |
81 name of the input file | |
82 -d OUTPUT_DIR, --output-dir=OUTPUT_DIR | |
83 path to output directory | |
84 -o OUTPUT_FILE, --output-file=OUTPUT_FILE | |
85 name of the output file (default | |
86 '<output_dir>/<locale>/<domain>.po') | |
87 -l LOCALE, --locale=LOCALE | |
88 locale for the new localized catalog | |
89 --first-author=FIRST_AUTHOR_NAME | |
90 name of first author | |
91 --first-author-email=FIRST_AUTHOR_EMAIL | |
92 email of first author | |
93 --project-name=NAME the project name | |
94 --project-version=VERSION | |
95 the project version |