Commit b2aa7dcf authored by Dennis Hendriks's avatar Dennis Hendriks
Browse files

#111 Railroad diagram cmdline argument (documentation) improvements.

 - Friendlier option values for output format.
 - Updated documentation.
parent 16aeb9e9
Pipeline #3868 passed with stage
in 0 seconds
......@@ -26,6 +26,7 @@ import java.util.List;
import java.util.function.Consumer;
import org.eclipse.escet.common.java.Assert;
import org.eclipse.escet.common.java.Strings;
import org.eclipse.escet.common.raildiagrams.config.Configuration;
import org.eclipse.escet.common.raildiagrams.output.DebugImageOutput;
import org.eclipse.escet.common.raildiagrams.output.NormalImageOutput;
......@@ -61,7 +62,7 @@ public class RailRoadDiagramGenerator {
Assert.check(args.length == 3 || args.length == 4, Arrays.toString(args));
Path inputPath = Paths.get(args[0]);
Path outputPath = Paths.get(args[1]);
OutputFormat outputFormat = OutputFormat.valueOf(args[2]);
OutputFormat outputFormat = OutputFormat.valueOf(Strings.makeUppercase(args[2]).replace('-', '_'));
Path configPath = (args.length == 3) ? null : Paths.get(args[3]);
generate(inputPath, configPath, outputPath, outputFormat, null, System.err::println);
......
......@@ -14,66 +14,20 @@
include::_part_attributes.asciidoc[]
[[rail-commandline]]
== Command-line options
== Command-line arguments
The railroad diagram application has common options shared with many other Esclipse ESCET applications, and several generator options to customize the output.
The railroad diagram application has several command line arguments.
The following command line arguments can be specified, in the given order:
Non-option values at the command-line are considered to be input files that should be processed by the generator like shown in <<rail-examples>>.
* The path to the input file that should be processed by the generator.
The file should contain a railroad diagram specification, like shown in <<rail-examples>>.
=== General options
* The path to the output image file.
[cols="1,1,3", options="header"]
|===
| Option | Default | Description
* The requested output format.
Specify `images` for a normal rail diagram `PNG` image.
Instead, `dbg-images` can be used to debug the diagram generator.
| `-h` or `--help`
| Disabled
| Get help about how to use the command-line of the railroad application.
| `--show-license`
| Disabled
| Outputs the license of the application.
| `--option-dialog=BOOL`
| `--option-dialog=no`
| Whether to show the option dialog after processing the specified commandline options.
| `-m OUTMODE` or `--output-mode=OUTMODE`
| `--output-mode=normal`
| Amount of output, specify `--output-mode=errors` for getting error output only, `--output-mode=warnings` for getting both errors and warnings as output, `--output-mode=normal` for errors, warnings, and normal output, and `--output-mode=debug` for getting all information that is available.
Note that the latter setting may cause a large amount of output and it may not be understandable unless you know about the internals of the application.
| `--gui=MODE`
| `--gui=auto`
| Whether to use GUI mode.
Use `--gui=off` to disable the GUI entirely which is useful for headless systems, specify `--gui=on` to force-enable the GUI, or `--gui=auto` to use the GUI if one is available.
| `--devmode=BOOL`
| `--devmode=no`
| When enabled with `--devmode=yes`, developer oriented information will be printed when a fault is detected in the program.
Otherwise, the information is written to a file with instructions to send that file to a developer for further analysis.
|===
=== Generator options
The tool currently has several generator options.
You can specify whether output should be written at all, and if so, you can specify the type of output.
[cols="1,1,3", options="header"]
|===
| Option | Default | Description
| `-c CFG` or `--config=CFG`
| Disabled
| The `CFG` value should be a path to a configuration file as explained in the <<rail-customizing-output>> section.
If specified the file contents is used for customizing diagram layout.
| `-f FMT` or `--format=FMT`
| `--format=images`
| The type of output of the program.
Currently `--format=images` produces normal rail diagram `PNG` files, while `--format=debug-images` is only useful for debugging the diagram generator.
| `-w B` or `--write-image=B`
| `--write-image=yes`
| Enable or disable writing the output file, use `--write-image=no` for disabling output.
|===
* Optionally, the path to the configuration file to use, as explained in the <<rail-customizing-output>> section.
If provided, the configuration file is used for customizing diagram layout.
If not provided, the default configuration is used.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment