1- .. _ usage:
1+ ## Usage
22
3- *****
4- Usage
5- *****
3+ This page describes how to invoke the java2python script, ` j2py ` .
64
7- Basic Invocation
8- ================
95
10- The simplest way to invoke |j2py| is with the :command:` j2py ` command
11- and the name of an input file::
6+ ### Basic Use
127
13- $ j2py SourceFile.java
8+ The simplest way to use java2python is with the ` j2py ` command
9+ and the name of an input file and output file:
1410
15- The input file may also be specified with the :option:` -i ` (or :option:` --input ` ) option.
11+ ``` bash
12+ $ j2py [INPUT] [OUTPUT]
13+ ```
1614
17- The generated source code will be written to `` stdout `` by default.
18- It can be redirected via the shell or by specifying the :option:` -o `
19- (or :option:` --output ` ) option and a filename.
15+ Both are optional, but you'll usually supply an input file. For example:
2016
21- If no input filename is given (or if the input filename is `` - `` ),
22- :command:` j2py ` reads from `` stdin `` .
17+ ``` bash
18+ $ j2py SourceFile.java
19+ ```
2320
2421
25- Options and Arguments
26- =====================
22+ ### Options and Arguments
2723
28- The :command: ` j2py ` command accepts options that alter its behavior.
24+ The ` j2py ` command accepts options that alter its behavior.
2925The behavior of the code generator is not part of the command itself;
30- to change code generation behavior, refer to the :ref: ` customization `
31- chapter .
26+ to change code generation behavior, refer to the [ customization] ( customization.md )
27+ page .
3228
3329
3430Code generation:
3531
36- * .. option:: -i NAME, --input NAME
32+ * ` [INPUT] `
3733
38- Read from the given file. Specify `` - `` for `` stdin ` ` . If not
39- given the command will read from `` stdin ` ` .
34+ Read from the given file. Specify ` - ` for ` stdin ` . If not
35+ given the command will read from ` stdin ` .
4036
41- * .. option:: -o NAME, --output NAME
37+ * ` [OUTPUT] `
4238
43- Write to the given file. Specify `` - `` for `` stdout ` ` . If not
44- given the command will write to `` stdout ` ` .
39+ Write to the given file. Specify ` - ` for ` stdout ` . If not
40+ given the command will write to ` stdout ` .
4541
46- * .. option:: -l LEVEL, --loglevel LEVEL
42+ * ` -l LEVEL ` , ` --loglevel LEVEL `
4743
4844 Set the logging package to the specified log level. The log level
49- may given as an integer (e.g., `` 50 ` ` for critical) or by name
50- (e.g., `` CRTICIAL `` , `` Critical `` , or `` critical ` ` ).
45+ may given as an integer (e.g., ` 50 ` for critical) or by name
46+ (e.g., ` CRITICAL ` , ` Critical ` , or ` critical ` ).
5147
52- * .. option:: -c NAME, --config NAME
48+ * ` -c NAME ` , ` --config NAME `
5349
5450 Use the specified configuration module or file. This option may
5551 be repeated.
@@ -58,57 +54,62 @@ Code generation:
5854 from the final value given to the first given, with the default
5955 configuration referenced last.
6056
61- See the :ref: ` customization ` chapter for details of the
57+ See the [ customization] ( customization.md ) page for details of the
6258 configuration system and available configuration points.
6359
64- * .. option:: -d DIR, --configdir DIR
60+ * ` -d DIR ` , ` --configdir DIR `
6561
66- Use the given directory name to match input filenames to
67- configuration filenames . For example, to translate
68- `` FooBar.java ` ` and use the configuration stored in
69- `` ./cfg/FooBar.py `` , specify `` -d ./cfg ` ` .
62+ Use the given directory name to match input file names to
63+ configuration file names . For example, to translate
64+ ` FooBar.java ` and use the configuration stored in
65+ ` ./cfg/FooBar.py ` , specify ` -d ./cfg ` .
7066
71- * .. option:: -n, --nodefaults
67+ * ` -k ` , ` --skip-compile `
68+
69+ Do not check the output for valid Python syntax by byte compiling it.
70+
71+ * ` -n ` , ` --nodefaults `
7272
7373 Ignore the default configuration module.
7474
75- * .. option:: -r, --nocolor
75+ * ` -r ` , ` --nocolor `
7676
7777 Disable colorized output.
7878
79- This option has no effect on Windows systems because colorized
80- output is always disabled in those environments.
79+ Colorized output is not available on Windows and this option has no effect
80+ there.
81+
8182
8283Development:
8384
84- * .. option:: -p, --python-tree
85+ * ` -p ` , ` --python-tree `
8586
8687 Print a representation of the internal Python code tree.
87- Representation is written to `` stderr ` ` .
88+ Representation is written to ` stderr ` .
8889
89- * .. option:: -j, --java-ast
90+ * ` -j ` , ` --java-ast `
9091
9192 Print a representation of the Java abstract syntax tree.
92- Representation is written to `` stderr ` ` .
93+ Representation is written to ` stderr ` .
9394
94- * .. option:: -f, --profile
95+ * ` -f ` , ` --profile `
9596
96- Profile execution and print the results to `` stederr ` ` .
97+ Profile execution and print the results to ` stderr ` .
9798
98- * .. option:: -s, --skip-source
99+ * ` -s ` , ` --skip-source `
99100
100101 Do not write generated source. This most useful in development of
101- |j2py| itself and when combined with :option: ` -p ` and/or
102- :option: ` -j ` .
102+ java2python itself and when combined with ` -p ` and/or
103+ ` -j ` .
103104
104105
105106Meta:
106107
107- * .. option:: -h, --help
108+ * ` -h ` , ` --help `
108109
109110 Show a help message and exit
110111
111- * .. option:: --version
112+ * ` -v ` , ` --version `
112113
113114 Show the program version number and exit.
114115
0 commit comments