diff --git a/tren.rst b/tren.rst index 62f995a..15351b2 100644 --- a/tren.rst +++ b/tren.rst @@ -937,7 +937,7 @@ In other words, each incremental renaming request honors the current state of the ``-T`` option. To turn off targeted -renaming - that is, make the whole file name the target again, +renaming - that is, make the whole file name the target again - simply include ``-T :`` on the command line. All renaming requests to the right of it will then target the whole name:: @@ -968,40 +968,34 @@ Each character in the name has an "index" or number that tells you what position is occupies in the name. You can -count from the *left end* of the name starting with 0: +count from the *left end* of the name starting with 0:: - ========= =============== Character Index From Left --------- --------------- - a 0 b 1 ... x 8 t 9 - ========= =============== - You can also count backwards relative to the *right end of -the name*: +the name*:: - ========= ================ Character Index From Right --------- ---------------= - a -10 b -9 ... x -2 t -1 - ========= ================ + Notice that left-relative indexes are positive numbers beginning with 0, but right-relative indexes are are negative numbers beginning at -1. So, what's a slice? A slice is a way of specifying *a range of one or more values*. -In the case of the ``-T`` argument, "values" means "positions in the name string -targeted for renaming." In the case of the ``-i`` argument, "values" means +In the case of the ``-T`` option, "values" means "positions in the name string +targeted for renaming." In the case of the ``-i`` option, "values" means *which instances of a given string should be renamed*. In our example above, the ``bcd`` portion of the name could be @@ -1012,7 +1006,7 @@ The general form of a slice is:: - first character/instance:stop on this character or instance + first character/instance:stop on this character/instance This can be tricky to get used to. The number on the righthand side *is not included in he slice* - it is where the slice *ends*. @@ -1020,7 +1014,7 @@ There are other shortcut forms of slice notation:: :3 # Same as 0:3 - 3: # Start with 4th char/instance and go through, and including last one + 3: # From 4th char/instance through/including end : # All chars/instances are included in the slice In short, slices are a compact way to specify a range of things. If @@ -3027,7 +3021,7 @@ :: - $Id: tren.rst,v 1.195 2010/11/16 20:22:12 tundra Exp $ + $Id: tren.rst,v 1.196 2010/11/16 20:31:33 tundra Exp $ You can find the latest version of this program at: