diff --git a/tren.rst b/tren.rst index be0c39f..22a83ef 100644 --- a/tren.rst +++ b/tren.rst @@ -8,12 +8,23 @@ :: - tren.py [-1abCcdEefghqtvXx] [-F file] [-l string] [-r old=new]... file|dir file|dir ... + tren.py [-1abCcdEefghqtvXx] [-I file] [-l string] [-r old=new]... file|dir file|dir ... OPTIONS ------- +You may specify *tren* options in one of three ways: + + 1) On the command line + 2) In an "include" file specified with ``-I filename`` on the command line + 3) Via the ``$TREN`` environment variable + +Note that options specified on the command line are evaluated from +left to right and supercede any options specified in the environment +variable. Think of any options set in ``$TREN`` as the "leftmost +command line options". + -1 Rename only the first instance of the specified string (*Default*: This is the program default) @@ -103,46 +114,6 @@ tren.py -e -r pe=p peg.jpeg # Renames file to peg.jpg - -F file Read command line arguments from ``file`` - - It is possible to perform multiple renaming operations in one - step using more than one ``-r`` option on the **tren** command - line. However, this can make the command line very long and - hard to read. This is especially true if the renaming strings - are complex, contain regular expressions or renaming - templates, or if you make heavy use of command line toggles. - - The ``-F`` option allows you to place any command line - arguments in a separate *file* in place of- or in addition to - the **tren** command line itself. This file is read one line - at a time and the contents appended to any existing command - line. You can even name the files you want renamed in the - file, but they must appear as the last lines of that file - (because they must appear last on the command line). - - Whitespace is ignored as is anything from a ``#`` to the end of - a line:: - - # Example replacement string file - # Each line appended sequentially - # to the command line - - -r t[ext]+=txt # Appended first - -c -g my=Mine - -X - -r =/L/ -r foo=bar - my.file - your.file # Appended last - - - .. NOTE:: There is one important difference between an actual - command line and keeping the arguments in a file like - this. *Filename wildcards are not expanded within the - file.* ``*.txt`` will typically be expanded by a command - shell to create a list of files ending in ``.txt``. - However, the ``*`` metacharacter has no such meaning when - used inside an arguments file. - -f Force renaming even if target file or directory name already exists. @@ -168,6 +139,47 @@ -h Print help information. + -I file "Include" command line arguments from ``file`` + + It is possible to perform multiple renaming operations in one + step using more than one ``-r`` option on the **tren** command + line. However, this can make the command line very long and + hard to read. This is especially true if the renaming strings + are complex, contain regular expressions or renaming + templates, or if you make heavy use of command line toggles. + + The ``-I`` option allows you to place any command line + arguments in a separate *file* in place of- or in addition to + the **tren** command line and/or the ``$TREN`` environment + variable. This file is read one line at a time and the + contents appended to any existing command line. You can even + name the files you want renamed in the file, but they must + appear as the last lines of that file (because they must appear + last on the command line). + + Whitespace is ignored as is anything from a ``#`` to the end of + a line:: + + # Example replacement string file + # Each line appended sequentially + # to the command line + + -r t[ext]+=txt # Appended first + -c -g my=Mine + -X + -r =/L/ -r foo=bar + my.file + your.file # Appended last + + + .. NOTE:: There is one important difference between an actual + command line and keeping the arguments in a file like + this. *Filename wildcards are not expanded within the + file.* ``*.txt`` will typically be expanded by a command + shell to create a list of files ending in ``.txt``. + However, the ``*`` metacharacter has no such meaning when + used inside an arguments file. + -l string File "extension" delimiter string. (*Default*: ".") @@ -1049,7 +1061,7 @@ :: - $Id: tren.rst,v 1.133 2010/01/21 23:47:40 tundra Exp $ + $Id: tren.rst,v 1.134 2010/01/22 17:46:04 tundra Exp $ You can find the latest version of this program at: