diff --git a/tren.rst b/tren.rst index 37cab74..95cb0be 100644 --- a/tren.rst +++ b/tren.rst @@ -178,7 +178,7 @@ When looking for a match on the old string to replace, **tren** will ignore the case of the characters found - in the filename. For example:: + in the file name. For example:: tren.py -cr Old=NEW Cold.txt fOlD.txt @@ -212,6 +212,39 @@ tren.py -tqd -r... -r... file file... + -e casetype Force case change to ``casetype``. + + (*Default*: No forced case.) + + This option supports a number of ``casetype`` arguments + to transform the case of the file name:: + + c - Capitalize the file name + l - Force file name to lower-case + s - Swap case of file name characters + t - Force file name to title case + u - Force file name to upper-case + + "Title case" just means that any alphabetic character following + a non-alphabetic character will be capitalized:: + + tren.py -et fee_fi_fo # -> Fee_Fi_Fo + + Notice that these case transformations are a kind of special + built-in renaming request with one important difference: The + ``-i`` "instance" setting is ignored. That's because the + ``-e`` option isn't based on replacing an "old" string like the + ``-r`` renaming option, but rather operates on the file name as + a whole. + + There is, however, a way to limit the effect of the case + forcing options because the ``-T`` or "target" option *is* + observed. You can thus limit the which portion of the file + name should have its case changed:: + + tren.py -T4:6 -eu fee_fi_fo # -> fee_FI_fo + + -f Force renaming even if target file or directory name already exists. @@ -272,7 +305,7 @@ the program will terminate. Note that wildcard metacharacters like ``*`` and ``?`` that are - embedded in filenames included this way are expanded as they + embedded in file names included this way are expanded as they would be from the command shell. You can define an environment variable, ``TRENINCL``, to specify @@ -730,7 +763,7 @@ Be careful with this one. If you apply it to a list of files or directories, it's going to try and name them all to the *same* name. -By default, **tren** will refuse to overwrite an existing filename, so +By default, **tren** will refuse to overwrite an existing file name, so it will stop you from doing this. If you absolutely insist on this via the ``-f`` option, you'll get a bunch of files ending with ``.backup``. Say you have files ``a``, ``b``, and ``c``:: @@ -1143,7 +1176,7 @@ design decision in these two operating systems. As a practical matter, the way to avoid this issue is to never do a renaming operation in OS X or Windows *that only converts case*. Try -to include some other change to the filename to keep the +to include some other change to the file name to keep the distinction between "old name" and "new name" clear to the OS. In the worst case, you'll have to resort to something like:: @@ -1377,7 +1410,7 @@ everything" in the existing file or directory name with our newly concocted naming scheme. -Of course, you don't *have* to replace the entire filename when +Of course, you don't *have* to replace the entire file name when using tokens. It's perfectly legitimate to replace only a portion of the existing name:: @@ -1649,7 +1682,7 @@ 97-... 98-... - The filenames are still preserved in our renaming reqest + The file names are still preserved in our renaming reqest above, now they're just preceded by the device ID of the where they live with a trailing ``-`` separator. @@ -2662,7 +2695,7 @@ tren.py -i -1 -r .jpeg=.jpg *.jpeg -- Replace Spaces In A Filename With Underbars +- Replace Spaces In A File Name With Underbars Even though spaces are allowed in file names in most OSs, they're a pain:: @@ -2827,7 +2860,7 @@ :: - $Id: tren.rst,v 1.191 2010/09/07 20:17:23 tundra Exp $ + $Id: tren.rst,v 1.192 2010/09/08 17:34:36 tundra Exp $ You can find the latest version of this program at: