Difference between revisions of "Command line"

From TTWiki
Jump to navigationJump to search
m (moved CommandLine to Command line: Spaces are good)
(Add sidebar)
 
Line 1: Line 1:
  +
{{Manual/Usage}}
 
The command line is an alternative way of selecting the patches. The format of the command line is<pre>TTDPatch [-C cfg-file] [options] [CD Path] [-W cfg-file]</pre>
 
The command line is an alternative way of selecting the patches. The format of the command line is<pre>TTDPatch [-C cfg-file] [options] [CD Path] [-W cfg-file]</pre>
   
Line 18: Line 19:
   
 
This will read <tt>mycfg.cfg</tt>, disable train refitting, and write the new configuration back to <tt>mycfg.cfg</tt> and then run TTD.
 
This will read <tt>mycfg.cfg</tt>, disable train refitting, and write the new configuration back to <tt>mycfg.cfg</tt> and then run TTD.
[[Category:Usage]][[Category:TTDPatch]][[Category:TTDPatch Manual]]
 

Latest revision as of 13:53, 31 July 2011

The command line is an alternative way of selecting the patches. The format of the command line is

TTDPatch [-C cfg-file] [options] [CD Path] [-W cfg-file]

The options can start with either a - (dash) or / (slash), followed by the list of options. All options can have another - after them to turn them off, and if there's an option that takes a parameter, the next option will be used as that value.

Each option is given by either a single letter, or by a capital "X" or "Y" followed by a letter, e.g. -abcXaXbYc. Note that all switches are case sensitive, and distinguish between upper case and lower case. Therefore, -g and -G are different switches.

If you have given a CD Path, if will be passed to TTD and tell it where it should go looking for the CD. (This only applies to the DOS version.)

Some switches don't have associated short command line switches, for example the many switches that control town growth rate calculation (see New Town Growth Switches). However, you can use a so-called `long switch', which is two dashes followed by the full switch name, for example --towngrowthratemin=50 or --trainrefit on. This is not as useful for the DOS version, which has a limit of 127 characters for the command line, but the Windows version has no such limit (although the command interpreter COMMAND.COM does, so under Windows 95/98/Me you may have to use an external tool to specify many long switches).

If you need a short reminder of all options, run `ttdpatch -h' which will show a short summary of all command line switches. If it's too much to fit on your screen, try `ttdpatch -h|more'.

A few examples to explain how the command line works:

ttdpatch -an- -i 90 -v

will start TTDPatch will all switches enabled (a) except for the new non-stop handling (n-) which is turned off. The default service interval is set to 90 days (-i 90), and before running TTD, all switches will be displayed to verify they are the way you want (-v).

ttdpatch -C mycfg.cfg

will use the file mycfg.cfg instead of the default ttdpatch.cfg to set the patches.

ttdpatch -C mycfg.cfg -f- -W mycfg.cfg

This will read mycfg.cfg, disable train refitting, and write the new configuration back to mycfg.cfg and then run TTD.