diff --git a/tren.rst b/tren.rst index 95cb0be..245fb68 100644 --- a/tren.rst +++ b/tren.rst @@ -330,6 +330,7 @@ -i instances Specifies which "instances" of matching strings should be replaced. + (*Default*: 0 or leftmost) A file may have multiple instances of the ``old`` @@ -375,9 +376,14 @@ -i :-2 # Instances to (not including) next-to-last -i : # All instances + + If you provide an instance range that makes no sense + or is out of range, ``tren`` will ignore the argument + and leave the instance specification unchanged. -P char Use ``char`` as the escape symbol. - (*Default*: ``\``) + + (*Default*: ``\``) -q Quiet mode, do not show progress. @@ -396,6 +402,7 @@ -R char Use ``char`` as the separator symbol in renaming specifications. + (*Default*: ``=``) @@ -454,6 +461,35 @@ can change it to any string you like with the ``-S``` option. + -T range Target the range of characters within file name subject to renaming. + + (*Default*: Entire file name is subject to renaming.) + + Ordinarily, ``tren`` applies renaming requests and forced + case conversions to the entire file name. The ``-T`` + option allows you to specify some substring of the name as + the "target" for renaming. The "range" argument is in the + same slice notation used for the ``-i`` command. So, for + example:: + + tren.py -T1:3 -r=XYZ abcdefg # -> aXYZdefg + + Similarly:: + + tren.py -T 1:4 -es aXYZdefg # -> axyzdefg + + The ``-T`` option operates on all subsequent renaming or + case forcing operations to the right of it on the command + line. So, if you want to go back to the default behavior of + applying renaming to the entire file, you have to set the + "target" back to the entire file name:: + + tren.py -T1:4 -es -T: -rg=-X axyzdeg # -> aXYZde-X + + As with the ``-i`` option, range slices that make no sense + or are out of range, are simply ignored, and the portion of + the file name targeted for renaming is left unchanged. + -t Test mode, don't rename, just show what the program *would* do. **tren** is very powerful and capable of doing nasty things to @@ -2860,7 +2896,7 @@ :: - $Id: tren.rst,v 1.192 2010/09/08 17:34:36 tundra Exp $ + $Id: tren.rst,v 1.193 2010/09/08 19:50:16 tundra Exp $ You can find the latest version of this program at: