Difference between revisions of "Command line parameters"

From TED Notepad
Line 1: Line 1:
<noinclude>{{manversion|5.3.0.2}}__NOTOC__</noinclude>
+
<noinclude>{{manversion|6.0.0.17|feature}}__NOTOC__</noinclude>
  
 
{{example_start}}
 
{{example_start}}
 
{{example_body}}
 
{{example_body}}
 
<b>TedNPad.exe
 
<b>TedNPad.exe
&nbsp;            [ {{field|/l<u>xx</u>}} | {{field|/c<u>xx</u>}} | {{field|/s<u>xx</u>,<u>yy</u>}} | {{field|/a}} ]
+
&nbsp;            [ {{field|Command line parameters|/l}}<u>xx</u> | {{field|Command line parameters|/c}}<u>xx</u> | {{field|Command line parameters|/s}}<u>xx</u>,<u>yy</u> | {{field|Command line parameters|/a}} ]
&nbsp;            [ {{field|/p}} ] [ {{field|/nl}} ] [ {{field|/ns}} ]
+
&nbsp;            [ {{field|Command line parameters|/p}} ] [ {{field|Command line parameters|/nl}} ] [ {{field|Command line parameters|/ns}} ]
 
&nbsp;            [drive:][path]filename</b>
 
&nbsp;            [drive:][path]filename</b>
 
{{example_end}}
 
{{example_end}}
  
Note: All parameters must precede the filename and be delimited with at least one {{defined|white-space}} to work properly. There must be no {{defined|white-space}} between a parameter and its value, if any. Some of the parameters are exclusive and should not be used together, or the result may be undefined otherwise and may change from version to version.
+
Note: All command line parameters must precede the filename to be loaded and must be delimited with at least one {{defined|white-space}} to work properly. Since version 6.0, {{defined|white-spaces}} between a parameter and its value are allowed. Some of the command line parameters are exclusive to each other and should not be used together, or the result may be undefined and may change from version to version.
  
====/l{{string|xx}} {{feature|Go to Line}}====
+
{{:Command line parameter /l Goto Line}}
 
+
{{:Command line parameter /c Goto Offset}}
After the file is loaded, automatically moves the caret to the beginning of the line {{string|xx}}. If there are not so many lines, the caret remains at the beginning of the document.
+
{{:Command line parameter /s Set Selection}}
 
+
{{:Command line parameter /a Select All}}
This parameter excludes {{feature|/s}} and {{feature|/a}} parameters.
+
<!-- ++++++++++++++++++++++++++++++++++ -->
 
+
{{:Command line parameter /p Print}}
====/c{{string|xx}} {{feature|Go to Char}}====
+
<!-- ++++++++++++++++++++++++++++++++++ -->
 
+
{{:Command line parameter /b Create New File}}
After the file is loaded, automatically moves the caret to the character {{string|xx}}. If there are not so many characters, the caret is moved to the end of the document.
+
<!-- ++++++++++++++++++++++++++++++++++ -->
 
+
{{:Command line parameter /i Config INI File}}
This parameter excludes {{feature|/s}} and {{feature|/a}} parameters.
+
<!-- ++++++++++++++++++++++++++++++++++ -->
 
+
{{:Command line parameter /nl Don't Load Settings}}
Use this parameter along with the {{feature|/l}} parameter to jump to a specific column on a specific line. If the chosen line is too short, the caret is placed respectively somewhere beyond it. In other words, when used in  conjuction with {{feature|/l}} parameter, the {{feature|/c}} parameter behaves relatively to the line from the {{feature|/l}} parameter.
+
{{:Command line parameter /ns Don't Save Settings}}
 
+
{{:Command line parameter /na No Lengthy Asserts}}
Note: The caret is moved only after all the {{defined|newline}} conversions are already done. If a Unix-type file is loaded and automatically identified, each {{defined|newline}} is converted into two characters (i.e. {{string|CR/LF}}). Any given {{feature|/c}} parameter should be specified likewise.
+
<!-- ++++++++++++++++++++++++++++++++++ -->
 
+
{{:Command line parameter /d Do Command}}
{{specific|[[RichEdit clone|RE clone]]}} There is a difference in counting {{defined|newlines}}. See section [[RichEdit clone]].
 
 
 
====/s{{string|xx}},{{string|yy}} {{feature|Set Selection}}====
 
 
 
After the file is loaded, automatically sets the selection from character number {{string|xx}} to character number {{string|yy}}. If there are not so many characters, the selection is shortened.
 
 
 
This parameter excludes {{feature|/l}}, {{feature|/c}} and {{feature|/a}} parameters.
 
 
 
{{specific|[[RichEdit clone|RE clone]]}} There is a difference in counting {{defined|newlines}}. See section [[RichEdit clone]].
 
 
 
====/a {{feature|Select All}}====
 
 
 
Automatically selects all text after the file is loaded.
 
 
 
This parameter excludes {{feature|/l}}, {{feature|/c}} and {{feature|/s}} parameters.
 
 
 
====/p {{feature|Print}}====
 
 
 
Prints the document after the file is loaded, then exits automatically.
 
 
 
====/nl {{feature|NoLoad Settings}}====
 
 
 
Simply skips any loading of any settings/options/data from the Registry or from the [[Portable INI file]]. Can be used to quicken the application start-up or for any kind of troubleshooting.
 
 
 
====/ns {{feature|NoSave Settings}}====
 
 
 
Simply skips any saving of any settings/options/data into the Registry or into the [[Portable INI file]]. Can be used to quicken the termination of the application or for any kind of troubleshooting.
 
 
 
Note, that even the {{feature|Save checked settings}} button in the {{dialog|Settings}} dialog will not work. See section [[Settings page]] of the {{dialog|Settings}} dialog.
 
 
 
====/d{{string|xx}} {{feature|Do Command}}====
 
 
 
<small>(temporary parameter, officially unpublished)</small>
 
 
 
This parameter can be used to auto-invoke an {{string|xx}} action in TED Notepad directly, after the application starts up and loads the file from the command line.
 
 
 
Caution: This parameter is a long-shot preparation for some macro support. Action numbers are not published by now and may be modified silently from time to time. They shall be published in the future. The behavior of this parameter may be modified silently from time to time until published as well.
 

Revision as of 11:31, 8 May 2012

This section is up to date for TED Notepad version 6.3.1.0.
Control page Control:feature:Command line parameters

TedNPad.exe   [ /lxx | /cxx | /sxx,yy | /a ]   [ /p ] [ /nl ] [ /ns ]   [drive:][path]filename

Note: All command line parameters must precede the filename to be loaded and must be delimited with at least one white-space to work properly. Since version 6.0, white-spaces between a parameter and its value are allowed. Some of the command line parameters are exclusive to each other and should not be used together, or the result may be undefined and may change from version to version.


/l xx Go to Line

After the file is fully loaded, moves the caret to the beginning of the line number xx. If there is no such line (too few lines in the document), the caret is positioned on the beginning of the last line of the document.

Note: Zero and negative numbers can be used as line number.

  • Zero means the last line of the document; and negative number means how many lines to go from the last line upwards, e.g. -1 means the penultimate line. Likewise to positive numbers, if there is no such line (too few lines), the caret is positioned on the beginning of the first line of the document.

This parameter can be used together with /c parameter, to further move the caret within given line.

This parameter excludes /s, /a and /E parameters.

/c xx Go to Offset

After the file is fully loaded, moves the caret to the offset xx. If there is no such offset (the document is too short), the caret is positioned to the end of the document.

Note: Zero and negative numbers can be used as offset number.

  • Zero means the end of the document, after the very last character; and negative number means how many characters to go from the end of the document upwards, e.g. -1 means before the last character. Likewise to positive numbers, if there is no such offset (the document is too short), the caret is positioned on the beginning of the document.

This parameter can be used together with /l parameter, to further move the caret within given line. If the given offset goes beyond the given line, the caret is pushed respectively further into text of the following lines, until the end of the document is reached. If zero or negative offset is given, the caret is moved naturally along previous lines, until the beginning of the document is reached. In other words, after the starting line is calculated from the /l parameter, offset calculation according to /c parameter is done relatively to the beginning of that line downwards or upwards, bound only with document boundaries.

This parameter excludes /s, /a and /E parameters.

Note: Since version 6.0, TED Notepad does not convert newlines upon loading, therefore there is no need to re-calculate offsets to match the extent of newlines conversion. However, multi-character encoding sequences still might get converted into single-character representations upon loading, e.g. in UTF-8 files.

/s xx,yy Set Selection

After the file is fully loaded, automatically sets the selection from offset number xx to offset number yy. If there is no such offset (the document is too short), the respective selection boundary is positioned to the end of the document.

Note: Zero and negative numbers can be used as offset numbers.

  • Zero means the end of the document, after the very last character; and negative number means how many characters to go from the end of the document upwards, e.g. -1 means before the last character. Likewise to positive numbers, if there is no such offset (the document is too short), the caret is positioned on the beginning of the document.

This parameter excludes /l, /c, /a and /E parameters.

/a Select All

Selects all text after the file is fully loaded.

This parameter excludes /l, /c, /s and /E parameters.

/p Print

Prints the document after the file is fully loaded, then exits.

/b Create New File

Skips questions about whether to create a new file, if the file given thru command line does not exist. Without this command line parameter, TED Notepad asks, whether to create a new file, if the file to be loaded cannot be found.

/i inifile Config INI File

Forces the application to use inifile file upon loading and saving Config.

Note: Hierarchical INI file loading and system Registry fallback do not apply, if this parameter is used. Loading of Config is strictly bound to this inifile.

TedNPad.exe /i "d:\config\ted notepad.ini" d:\my notepad\todo.txt

Note: If the inifile contains spaces, make sure to use double quotes. Double quotes are not needed only if the inifile contains no white-spaces.

/nl Don't Load Settings

Skips any attempts to load Config from system Registry or Cascading Portable INI files. Can be used to quicken the application start-up, or for any kind of troubleshooting.

TedNPad.exe /nl /ns d:\my notepad\todo.txt

/ns Don't Save Settings

Skips any attempts to save Config into system Registry or Cascading Portable INI files. Can be used to quicken the termination of the application, or for any kind of troubleshooting.

Note: The Save checked button in the Settings dialog won't work as well. See section Settings page of the Settings dialog.

TedNPad.exe /nl /ns d:\my notepad\todo.txt

/na No Lengthy Asserts

(this parameter is only available in testing versions, do not use it in public releases)

Skips lengthy storage asserts after each text operation. With small files, this is usually not necessary. However, storage assertions can become a big nuisance with larger files. This parameter allows to skip the most lengthy tests, it does not, however, disable all testing routines.

/d xx Do Command

(temporary parameter, officially unpublished, subject to change without notice)

This parameter can be used to directly auto-invoke an xx action in TED Notepad, after the application starts up and loads the file from the command line. While the xx is a number of action to invoke, list of action numbers is not available yet. However, using various tools, advanced users can perhaps find these numbers out on their own, since these action numbers are the command numbers used by the application menu and accelerators.

Caution: This parameter was a long-shot attempt to provide macro support, and was never finished. Action numbers may change silently from version to version. Behavior of this parameter may be modified silently as well.