diff --git a/ChangeLog b/ChangeLog index 2cc8a0e..d66f102 100644 --- a/ChangeLog +++ b/ChangeLog @@ -115,3 +115,10 @@ Bug fix: inconsistency in reserved directory index. 3. Two more options added: `-ifp/d` and `-ifp/s`. ###`3.3.0`: Fri Dec 18 19:03:11 UTC 2015 + +1. `-ifp/d` and `-ifp/s` options removed. Numerous options are added to achieve the same effect. +2. `-if` option added. It can be used to manipulate how the indexes are rendered in it's field. +3. Support for base conversion of indexes (from base 2 to 36) added. +4. Support for Latin conversion of indexes added. +5. Support for extended name string rules. +6. Support for extended name string rules of /pd/. diff --git a/README b/README index f95e380..608a85f 100644 --- a/README +++ b/README @@ -11,8 +11,9 @@ Bulk Rename Utility written in `C++`. Files and directories can be passed as com 3. Names can be modified by performing regex replace. It enables generating new names by deleting/appending/modifying part of the old filename. It also enables easy conversion from lowercase to uppercase and vice-versa. 4. Lowercase-Uppercase conversion is selective i.e you can apply case conversion in part of the name at a targeted position. 5. Names can be modified with certain predefined rules. For example, you can insert parent directory name or working directory name or index etc... in filename in arbitrary positions. +6. Latin indexing of files. Index can also be converted to different bases (binary, hex, oct etc...). 6. Names can be taken from a file, and these names can also be modified by applying *Name String* rules on them. -7. Search functionality. It uses the ECMAScript regex by default. Regex mode can be changed (POSIX basic, extended, egrep, grep, awk, ECMAScript). Fixed string search is also possible. +7. Search functionality. It uses the ECMAScript (aka JavaScript) regex by default. Regex mode can be changed (POSIX basic, extended, egrep, grep, awk, ECMAScript). Fixed string search is also possible. 8. Null terminated file support for file names (Null termination is a good way to store filenames in a file). 9. Sort functionality. Available sorting methods are: Natural sort and general alphabetical sort. 10. Multiple search criteria and replacement methods are possible. @@ -81,11 +82,11 @@ Options | Description `-ei` | End index i.e index to stop renaming from. It is only for files inside a directory that is being recursively taken due to a depth value greater than 0, i.e it works on directory index. Note that directory index `/id/` will renew in each directory i.e in each directory rename will be performed from start index to end index. `-inc` | Increment value (floating point decimal). The amount, index will be incremented or decremented in each iteration. Decremented index is available through name string rule| `/-i/`, `/-id/` etc.. `-linc` | The amount line count will be incremented or decremented in each iteration. This is always a positive integer. +`-if` | This sets Index flags. This is a '/' separated list of flags that will be used to render the index within it's text field. The general format is `'/keyword1/keyword2/...'`. Valued flags are set with *keyword=value* format. Ex: `-if '/uppercase/showpoint/showpos/showbase/left/length=4/precision=3/filler=*/latin-fallback=687678/'`. +See keywords section for details. `-ifl` | Index field length. Non occupied field will be filled with index field fillers (set with `-iff`). iff is set to the character `0` by default. `-iff` | Not occupied field in index will be filled with a character which is set by this option. `-ifp` | Index is a floating point decimal value. This sets the precision. If it is less than the number of digits left of the decimal point, the indexes may be rendered in scientific format.This option only sets the precision value. The result may be confusing and you shouldn't use this option unless you know what you are doing. Make it specific with `-ifp/d` or `-ifp/s` which set type of format (fixed point or scientific) along with the precision value. -`-ifp/d` | This sets the decimal precision i.e the number of digits that would be taken after the decimal point. If this option is passed other types of precisions will be ignored (if passed alongside). Mind that only the type is ignored not the value i.e the precision value will be overwritten always. -`-ifp/s` | This sets the scientific precision. All indexes will be rendered in scientific form. `-ns` | Name string. `-ns/f` | Name string file. File containing name string (one per line). `-nsf /hist/` i.e a value passed `/hist/` as Name string file, will try to take the file from history. `-ns/fn` | Name String file. This takes a null terminated *Name String* file, i.e filenames are terminated by null character (`\0`) instead of new line (`\n`). @@ -126,7 +127,8 @@ Options | Description to reserve the index for that skipped file **Reverse Index :** Decrementing index. - + +
**Name String :** A string, that is parsed to create names for new files. It can be fixed name which then can be modified for different files at runtime. Name sting is parsed by the following rules (must be wrapped around with filepath delimiter `/`): @@ -143,14 +145,31 @@ Options | Description 11. `/fn/` in name string will be replaced with full name of the files. If used with `-nsf` option, full name will be the name taken from the *Name String File*. 12. `/rn/` in name string will be replaced with Replaced Name. 13. `/pd/` in name string will be replaced with parent directory name of the current file or directory. -14. `/wd/` in name string will be replaced with the current working directory name. +14. `/wd/` in name string will be replaced with the current working directory name. + +
+**Extended Name String Rule :** This is an extension of the general purpose name string rules mentioned above. + +1. Base conversion: `/i-b2/` converts the index to base 2 i.e binary and `/i-b32/` will convert to base 32. This applies to all numbered name string rules. +2. Latin conversion: `/i-l/` converts the index to Latin number. This applies to all numbered name string rules. +3. Scientific conversion: `/i-s/` converts the index to scientific form. This applies to all numbered name string rules. +4. Extended /pd/ rules: + * `pd0` is the immediate parent directory, `pd1` is the directory before pd0 and so forth. + * A range can also be supplied to combine all the directories in the level implied by the range. The general format of this rule is `/pd--delimiter/` + * For example: `/pd0-4--/` will combine all directories from level 0 to 4 inserting the delimiter (`-` in this case) between them and the rule will become something like `dir0-dir1-dir2-dir3-dir4`. + * In place of `` you can also supply `e` which generally means the 'end' i.e the deepest level available. + * Any unavailable level of directory will be ignored and be replaced with empty string. + * The range is bidirectional e.g `/pd4-0--/` will do the same in reverse order. + + **Name String File :** A file which contains a list of name string (one per line). Empty lines will be ignored and line number won't be counted. Actual line number (which counts the empty lines too) is available through name string rule : `/la/`. - + +
**Search String :** A string that is used to search for files with matching filenames against the search string. By default it is a regex if `-ssF` option is not used.It is generally in the form `/regex/modifier` , @@ -173,7 +192,9 @@ Also you can provide multiple search strings with repeated `-ss` and/or `-ssf` o which can be used in *Name String*. If name string is not passed as argument, the new name of the file will be `/rn/`. *Replaced Name* is always generated from the old filename. - + + +
**Replace String :** *Replace String* is a regex of the form: `/search_part/replace_part/modifier` where search_part is the regex to search for and @@ -201,8 +222,23 @@ of 'video' with 'Episode index' i.e you will get new rname as:. Episode 1..., Episode 2..., etc... ``` - +
**Regex :** Supported regexes are POSIX compliant basic & extended regex, grep, egrep and awk type regexes and the default ECMAScript Regex. You can change the regex mode with `-re` or `--regex` option. + +
+**Keywords :** + +* *uppercase* : means uppercase. +* *showpoint : show point regardless if it's an integer or floating point value. +* showbase : means show base (Hex or Oct). +* showpos : show + sign for positive numbers. +* right : adjust right. +* left : adjust left. +* internal : adjust internal. +* precision : set precision. Used like precision=value +* length : sets length. Used like length=value +* filler : sets filler. Used like filler=value + Only invalid characters for a file or directory name is the path delimiter and the null character (`\0`). diff --git a/README.md b/README.md index f95e380..608a85f 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ Bulk Rename Utility written in `C++`. Files and directories can be passed as com 3. Names can be modified by performing regex replace. It enables generating new names by deleting/appending/modifying part of the old filename. It also enables easy conversion from lowercase to uppercase and vice-versa. 4. Lowercase-Uppercase conversion is selective i.e you can apply case conversion in part of the name at a targeted position. 5. Names can be modified with certain predefined rules. For example, you can insert parent directory name or working directory name or index etc... in filename in arbitrary positions. +6. Latin indexing of files. Index can also be converted to different bases (binary, hex, oct etc...). 6. Names can be taken from a file, and these names can also be modified by applying *Name String* rules on them. -7. Search functionality. It uses the ECMAScript regex by default. Regex mode can be changed (POSIX basic, extended, egrep, grep, awk, ECMAScript). Fixed string search is also possible. +7. Search functionality. It uses the ECMAScript (aka JavaScript) regex by default. Regex mode can be changed (POSIX basic, extended, egrep, grep, awk, ECMAScript). Fixed string search is also possible. 8. Null terminated file support for file names (Null termination is a good way to store filenames in a file). 9. Sort functionality. Available sorting methods are: Natural sort and general alphabetical sort. 10. Multiple search criteria and replacement methods are possible. @@ -81,11 +82,11 @@ Options | Description `-ei` | End index i.e index to stop renaming from. It is only for files inside a directory that is being recursively taken due to a depth value greater than 0, i.e it works on directory index. Note that directory index `/id/` will renew in each directory i.e in each directory rename will be performed from start index to end index. `-inc` | Increment value (floating point decimal). The amount, index will be incremented or decremented in each iteration. Decremented index is available through name string rule| `/-i/`, `/-id/` etc.. `-linc` | The amount line count will be incremented or decremented in each iteration. This is always a positive integer. +`-if` | This sets Index flags. This is a '/' separated list of flags that will be used to render the index within it's text field. The general format is `'/keyword1/keyword2/...'`. Valued flags are set with *keyword=value* format. Ex: `-if '/uppercase/showpoint/showpos/showbase/left/length=4/precision=3/filler=*/latin-fallback=687678/'`. +See keywords section for details. `-ifl` | Index field length. Non occupied field will be filled with index field fillers (set with `-iff`). iff is set to the character `0` by default. `-iff` | Not occupied field in index will be filled with a character which is set by this option. `-ifp` | Index is a floating point decimal value. This sets the precision. If it is less than the number of digits left of the decimal point, the indexes may be rendered in scientific format.This option only sets the precision value. The result may be confusing and you shouldn't use this option unless you know what you are doing. Make it specific with `-ifp/d` or `-ifp/s` which set type of format (fixed point or scientific) along with the precision value. -`-ifp/d` | This sets the decimal precision i.e the number of digits that would be taken after the decimal point. If this option is passed other types of precisions will be ignored (if passed alongside). Mind that only the type is ignored not the value i.e the precision value will be overwritten always. -`-ifp/s` | This sets the scientific precision. All indexes will be rendered in scientific form. `-ns` | Name string. `-ns/f` | Name string file. File containing name string (one per line). `-nsf /hist/` i.e a value passed `/hist/` as Name string file, will try to take the file from history. `-ns/fn` | Name String file. This takes a null terminated *Name String* file, i.e filenames are terminated by null character (`\0`) instead of new line (`\n`). @@ -126,7 +127,8 @@ Options | Description to reserve the index for that skipped file **Reverse Index :** Decrementing index. - + +
**Name String :** A string, that is parsed to create names for new files. It can be fixed name which then can be modified for different files at runtime. Name sting is parsed by the following rules (must be wrapped around with filepath delimiter `/`): @@ -143,14 +145,31 @@ Options | Description 11. `/fn/` in name string will be replaced with full name of the files. If used with `-nsf` option, full name will be the name taken from the *Name String File*. 12. `/rn/` in name string will be replaced with Replaced Name. 13. `/pd/` in name string will be replaced with parent directory name of the current file or directory. -14. `/wd/` in name string will be replaced with the current working directory name. +14. `/wd/` in name string will be replaced with the current working directory name. + +
+**Extended Name String Rule :** This is an extension of the general purpose name string rules mentioned above. + +1. Base conversion: `/i-b2/` converts the index to base 2 i.e binary and `/i-b32/` will convert to base 32. This applies to all numbered name string rules. +2. Latin conversion: `/i-l/` converts the index to Latin number. This applies to all numbered name string rules. +3. Scientific conversion: `/i-s/` converts the index to scientific form. This applies to all numbered name string rules. +4. Extended /pd/ rules: + * `pd0` is the immediate parent directory, `pd1` is the directory before pd0 and so forth. + * A range can also be supplied to combine all the directories in the level implied by the range. The general format of this rule is `/pd--delimiter/` + * For example: `/pd0-4--/` will combine all directories from level 0 to 4 inserting the delimiter (`-` in this case) between them and the rule will become something like `dir0-dir1-dir2-dir3-dir4`. + * In place of `` you can also supply `e` which generally means the 'end' i.e the deepest level available. + * Any unavailable level of directory will be ignored and be replaced with empty string. + * The range is bidirectional e.g `/pd4-0--/` will do the same in reverse order. + + **Name String File :** A file which contains a list of name string (one per line). Empty lines will be ignored and line number won't be counted. Actual line number (which counts the empty lines too) is available through name string rule : `/la/`. - + +
**Search String :** A string that is used to search for files with matching filenames against the search string. By default it is a regex if `-ssF` option is not used.It is generally in the form `/regex/modifier` , @@ -173,7 +192,9 @@ Also you can provide multiple search strings with repeated `-ss` and/or `-ssf` o which can be used in *Name String*. If name string is not passed as argument, the new name of the file will be `/rn/`. *Replaced Name* is always generated from the old filename. - + + +
**Replace String :** *Replace String* is a regex of the form: `/search_part/replace_part/modifier` where search_part is the regex to search for and @@ -201,8 +222,23 @@ of 'video' with 'Episode index' i.e you will get new rname as:. Episode 1..., Episode 2..., etc... ``` - +
**Regex :** Supported regexes are POSIX compliant basic & extended regex, grep, egrep and awk type regexes and the default ECMAScript Regex. You can change the regex mode with `-re` or `--regex` option. + +
+**Keywords :** + +* *uppercase* : means uppercase. +* *showpoint : show point regardless if it's an integer or floating point value. +* showbase : means show base (Hex or Oct). +* showpos : show + sign for positive numbers. +* right : adjust right. +* left : adjust left. +* internal : adjust internal. +* precision : set precision. Used like precision=value +* length : sets length. Used like length=value +* filler : sets filler. Used like filler=value + Only invalid characters for a file or directory name is the path delimiter and the null character (`\0`). diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 index e9022f2..e5d8268 100644 --- a/autom4te.cache/output.0 +++ b/autom4te.cache/output.0 @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.69 for rnm 3.2.3. +@%:@ Generated by GNU Autoconf 2.69 for rnm 3.3.0. @%:@ @%:@ Report bugs to . @%:@ @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rnm' PACKAGE_TARNAME='rnm' -PACKAGE_VERSION='3.2.3' -PACKAGE_STRING='rnm 3.2.3' +PACKAGE_VERSION='3.3.0' +PACKAGE_STRING='rnm 3.3.0' PACKAGE_BUGREPORT='http://github.com/neurobin/rnm/issues' PACKAGE_URL='' @@ -1275,7 +1275,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rnm 3.2.3 to adapt to many kinds of systems. +\`configure' configures rnm 3.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1341,7 +1341,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rnm 3.2.3:";; + short | recursive ) echo "Configuration of rnm 3.3.0:";; esac cat <<\_ACEOF @@ -1434,7 +1434,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rnm configure 3.2.3 +rnm configure 3.3.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1895,7 +1895,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rnm $as_me 3.2.3, which was +It was created by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2763,7 +2763,7 @@ fi # Define the identity of the package. PACKAGE='rnm' - VERSION='3.2.3' + VERSION='3.3.0' cat >>confdefs.h <<_ACEOF @@ -5396,7 +5396,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rnm $as_me 3.2.3, which was +This file was extended by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5453,7 +5453,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rnm config.status 3.2.3 +rnm config.status 3.3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1 index e9022f2..e5d8268 100644 --- a/autom4te.cache/output.1 +++ b/autom4te.cache/output.1 @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.69 for rnm 3.2.3. +@%:@ Generated by GNU Autoconf 2.69 for rnm 3.3.0. @%:@ @%:@ Report bugs to . @%:@ @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rnm' PACKAGE_TARNAME='rnm' -PACKAGE_VERSION='3.2.3' -PACKAGE_STRING='rnm 3.2.3' +PACKAGE_VERSION='3.3.0' +PACKAGE_STRING='rnm 3.3.0' PACKAGE_BUGREPORT='http://github.com/neurobin/rnm/issues' PACKAGE_URL='' @@ -1275,7 +1275,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rnm 3.2.3 to adapt to many kinds of systems. +\`configure' configures rnm 3.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1341,7 +1341,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rnm 3.2.3:";; + short | recursive ) echo "Configuration of rnm 3.3.0:";; esac cat <<\_ACEOF @@ -1434,7 +1434,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rnm configure 3.2.3 +rnm configure 3.3.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1895,7 +1895,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rnm $as_me 3.2.3, which was +It was created by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2763,7 +2763,7 @@ fi # Define the identity of the package. PACKAGE='rnm' - VERSION='3.2.3' + VERSION='3.3.0' cat >>confdefs.h <<_ACEOF @@ -5396,7 +5396,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rnm $as_me 3.2.3, which was +This file was extended by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5453,7 +5453,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rnm config.status 3.2.3 +rnm config.status 3.3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/autom4te.cache/output.2 b/autom4te.cache/output.2 index e9022f2..e5d8268 100644 --- a/autom4te.cache/output.2 +++ b/autom4te.cache/output.2 @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.69 for rnm 3.2.3. +@%:@ Generated by GNU Autoconf 2.69 for rnm 3.3.0. @%:@ @%:@ Report bugs to . @%:@ @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rnm' PACKAGE_TARNAME='rnm' -PACKAGE_VERSION='3.2.3' -PACKAGE_STRING='rnm 3.2.3' +PACKAGE_VERSION='3.3.0' +PACKAGE_STRING='rnm 3.3.0' PACKAGE_BUGREPORT='http://github.com/neurobin/rnm/issues' PACKAGE_URL='' @@ -1275,7 +1275,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rnm 3.2.3 to adapt to many kinds of systems. +\`configure' configures rnm 3.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1341,7 +1341,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rnm 3.2.3:";; + short | recursive ) echo "Configuration of rnm 3.3.0:";; esac cat <<\_ACEOF @@ -1434,7 +1434,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rnm configure 3.2.3 +rnm configure 3.3.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1895,7 +1895,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rnm $as_me 3.2.3, which was +It was created by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2763,7 +2763,7 @@ fi # Define the identity of the package. PACKAGE='rnm' - VERSION='3.2.3' + VERSION='3.3.0' cat >>confdefs.h <<_ACEOF @@ -5396,7 +5396,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rnm $as_me 3.2.3, which was +This file was extended by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5453,7 +5453,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rnm config.status 3.2.3 +rnm config.status 3.3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/autom4te.cache/requests b/autom4te.cache/requests index e578216..337f1b1 100644 --- a/autom4te.cache/requests +++ b/autom4te.cache/requests @@ -34,47 +34,47 @@ 'configure.ac' ], { - 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AM_SET_DEPDIR' => 1, - 'AM_CONDITIONAL' => 1, - 'AM_SILENT_RULES' => 1, - 'AC_DEFUN' => 1, - '_AM_AUTOCONF_VERSION' => 1, - '_AM_MANGLE_OPTION' => 1, - '_AC_AM_CONFIG_HEADER_HOOK' => 1, - 'AM_SANITY_CHECK' => 1, - '_m4_warn' => 1, - '_AM_PROG_TAR' => 1, + '_AM_PROG_CC_C_O' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, '_AM_DEPENDENCIES' => 1, + 'AU_DEFUN' => 1, + 'AM_DEP_TRACK' => 1, + '_AM_PROG_TAR' => 1, + 'm4_pattern_forbid' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'AM_RUN_LOG' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + '_AM_SET_OPTIONS' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_AM_SUBST_NOTMAKE' => 1, 'AM_MAKE_INCLUDE' => 1, + 'AM_PROG_CC_C_O' => 1, 'AM_AUX_DIR_EXPAND' => 1, - 'AM_MISSING_PROG' => 1, - 'AM_AUTOMAKE_VERSION' => 1, + 'AC_DEFUN' => 1, + 'AM_SANITY_CHECK' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, 'AC_DEFUN_ONCE' => 1, - 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AM_MISSING_PROG' => 1, + '_AM_SET_OPTION' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, 'm4_pattern_allow' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AC_CONFIG_MACRO_DIR' => 1, - 'AM_PROG_INSTALL_SH' => 1, - 'AM_DEP_TRACK' => 1, - '_AM_PROG_CC_C_O' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AM_SUBST_NOTMAKE' => 1, - 'AM_PROG_CC_C_O' => 1, - '_AM_SET_OPTIONS' => 1, 'm4_include' => 1, - 'AM_PROG_INSTALL_STRIP' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + '_AM_AUTOCONF_VERSION' => 1, 'include' => 1, - 'AM_SET_LEADING_DOT' => 1, - 'm4_pattern_forbid' => 1, - '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'AM_MISSING_HAS_RUN' => 1, - '_AM_SET_OPTION' => 1, - 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - '_AM_IF_OPTION' => 1, + 'AM_INIT_AUTOMAKE' => 1, + '_AM_MANGLE_OPTION' => 1, + 'AM_SET_DEPDIR' => 1, + '_m4_warn' => 1, + 'AM_SET_LEADING_DOT' => 1, + 'AM_CONDITIONAL' => 1, '_AM_CONFIG_MACRO_DIRS' => 1, - 'AU_DEFUN' => 1 + 'AM_SUBST_NOTMAKE' => 1, + '_AM_IF_OPTION' => 1, + 'AM_SILENT_RULES' => 1 } ], 'Autom4te::Request' ), bless( [ @@ -91,63 +91,63 @@ 'configure.ac' ], { - 'include' => 1, - 'AC_FC_PP_DEFINE' => 1, + 'AM_PATH_GUILE' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'LT_INIT' => 1, + 'AC_FC_FREEFORM' => 1, 'm4_pattern_forbid' => 1, - 'AM_MAINTAINER_MODE' => 1, + 'AC_CANONICAL_HOST' => 1, 'AM_XGETTEXT_OPTION' => 1, - 'AM_PROG_AR' => 1, - 'LT_INIT' => 1, - '_AM_MAKEFILE_INCLUDE' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AM_PROG_F77_C_O' => 1, - 'AC_SUBST_TRACE' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AM_PROG_CXX_C_O' => 1, - 'LT_SUPPORTED_TAG' => 1, - '_AM_COND_IF' => 1, - 'AM_POT_TOOLS' => 1, - 'AH_OUTPUT' => 1, 'AM_NLS' => 1, - 'AC_CANONICAL_TARGET' => 1, - 'AM_PATH_GUILE' => 1, - 'AM_PROG_FC_C_O' => 1, - 'AC_CONFIG_HEADERS' => 1, - '_AM_COND_ENDIF' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, '_AM_SUBST_NOTMAKE' => 1, - 'AC_CANONICAL_BUILD' => 1, - 'AC_CONFIG_LINKS' => 1, - 'AM_PROG_CC_C_O' => 1, - 'm4_include' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AC_FC_PP_SRCEXT' => 1, 'sinclude' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - '_AM_COND_ELSE' => 1, - 'AM_PROG_MOC' => 1, 'm4_sinclude' => 1, - 'AM_AUTOMAKE_VERSION' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_PROG_CC_C_O' => 1, 'AC_LIBSOURCE' => 1, - 'AM_GNU_GETTEXT' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, + '_AM_COND_ENDIF' => 1, 'AC_REQUIRE_AUX_FILE' => 1, - 'AC_FC_FREEFORM' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_INIT' => 1, 'AC_FC_SRCEXT' => 1, - 'AM_ENABLE_MULTILIB' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + '_AM_COND_IF' => 1, + 'LT_SUPPORTED_TAG' => 1, 'm4_pattern_allow' => 1, + 'AM_PROG_AR' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_CONFIG_AUX_DIR' => 1, 'AM_INIT_AUTOMAKE' => 1, - 'AC_INIT' => 1, + 'AC_CANONICAL_BUILD' => 1, 'AC_SUBST' => 1, + 'm4_include' => 1, + 'include' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, 'AM_CONDITIONAL' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AH_OUTPUT' => 1, + '_m4_warn' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AM_POT_TOOLS' => 1, + 'AM_PROG_MOC' => 1, + 'AC_FC_PP_DEFINE' => 1, 'AM_SILENT_RULES' => 1, - 'AC_PROG_LIBTOOL' => 1, + 'AM_PROG_FC_C_O' => 1, + '_AM_COND_ELSE' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + 'AC_SUBST_TRACE' => 1, 'AC_CONFIG_FILES' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - '_m4_warn' => 1 + 'AC_CANONICAL_TARGET' => 1 } ], 'Autom4te::Request' ), bless( [ @@ -162,65 +162,65 @@ 'configure.ac' ], { + '_AM_COND_ENDIF' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'AC_PROG_LIBTOOL' => 1, 'AC_INIT' => 1, - 'AC_SUBST' => 1, - 'AM_CONDITIONAL' => 1, + 'AC_FC_SRCEXT' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'm4_sinclude' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'sinclude' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AM_PATH_GUILE' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'LT_INIT' => 1, + 'AC_CANONICAL_HOST' => 1, + 'm4_pattern_forbid' => 1, + 'AC_FC_FREEFORM' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_NLS' => 1, + 'AM_POT_TOOLS' => 1, + 'AM_PROG_MOC' => 1, + 'AC_FC_PP_DEFINE' => 1, 'AM_SILENT_RULES' => 1, - 'AC_PROG_LIBTOOL' => 1, + 'AM_PROG_FC_C_O' => 1, + '_AM_COND_ELSE' => 1, 'AC_CONFIG_FILES' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AC_SUBST_TRACE' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_CONFIG_SUBDIRS' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AH_OUTPUT' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, '_m4_warn' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AC_FC_PP_SRCEXT' => 1, - 'sinclude' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - '_AM_COND_ELSE' => 1, - 'AM_PROG_MOC' => 1, - 'm4_sinclude' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AC_LIBSOURCE' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AC_CANONICAL_SYSTEM' => 1, 'AM_GNU_GETTEXT' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AC_REQUIRE_AUX_FILE' => 1, - 'AC_FC_FREEFORM' => 1, - 'AC_FC_SRCEXT' => 1, - 'm4_pattern_allow' => 1, - 'AM_ENABLE_MULTILIB' => 1, - 'AM_INIT_AUTOMAKE' => 1, - '_AM_COND_IF' => 1, - 'AM_EXTRA_RECURSIVE_TARGETS' => 1, - 'AM_POT_TOOLS' => 1, - 'AH_OUTPUT' => 1, - 'AM_NLS' => 1, - 'AC_CANONICAL_TARGET' => 1, - 'AM_PROG_FC_C_O' => 1, - 'AM_PATH_GUILE' => 1, 'AC_CONFIG_HEADERS' => 1, - '_AM_COND_ENDIF' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AC_CANONICAL_BUILD' => 1, - 'AC_CONFIG_LINKS' => 1, - 'AM_PROG_MKDIR_P' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AM_INIT_AUTOMAKE' => 1, 'm4_include' => 1, - 'AM_PROG_CC_C_O' => 1, + 'AC_SUBST' => 1, + 'AC_CANONICAL_BUILD' => 1, 'include' => 1, - 'AC_FC_PP_DEFINE' => 1, - 'm4_pattern_forbid' => 1, - 'AM_XGETTEXT_OPTION' => 1, - 'AM_MAINTAINER_MODE' => 1, - 'AM_PROG_AR' => 1, - 'LT_INIT' => 1, - '_AM_MAKEFILE_INCLUDE' => 1, '_LT_AC_TAGCONFIG' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AM_PROG_F77_C_O' => 1, - 'AC_SUBST_TRACE' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AM_PROG_CXX_C_O' => 1, - 'LT_SUPPORTED_TAG' => 1 + '_AM_COND_IF' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_PROG_AR' => 1, + 'm4_pattern_allow' => 1, + 'AC_CONFIG_LINKS' => 1 } ], 'Autom4te::Request' ) ); diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1 index 4e65fff..69dc0f6 100644 --- a/autom4te.cache/traces.1 +++ b/autom4te.cache/traces.1 @@ -1,4 +1,4 @@ -m4trace:configure.ac:1: -1- AC_INIT([rnm], [3.2.3], [http://github.com/neurobin/rnm/issues]) +m4trace:configure.ac:1: -1- AC_INIT([rnm], [3.3.0], [http://github.com/neurobin/rnm/issues]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) diff --git a/autom4te.cache/traces.2 b/autom4te.cache/traces.2 index 4e65fff..69dc0f6 100644 --- a/autom4te.cache/traces.2 +++ b/autom4te.cache/traces.2 @@ -1,4 +1,4 @@ -m4trace:configure.ac:1: -1- AC_INIT([rnm], [3.2.3], [http://github.com/neurobin/rnm/issues]) +m4trace:configure.ac:1: -1- AC_INIT([rnm], [3.3.0], [http://github.com/neurobin/rnm/issues]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) diff --git a/build/rnm-3.3.0.tar.gz b/build/rnm-3.3.0.tar.gz new file mode 100644 index 0000000..5090e54 Binary files /dev/null and b/build/rnm-3.3.0.tar.gz differ diff --git a/configure b/configure index c2a6521..8a002f8 100644 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for rnm 3.2.3. +# Generated by GNU Autoconf 2.69 for rnm 3.3.0. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rnm' PACKAGE_TARNAME='rnm' -PACKAGE_VERSION='3.2.3' -PACKAGE_STRING='rnm 3.2.3' +PACKAGE_VERSION='3.3.0' +PACKAGE_STRING='rnm 3.3.0' PACKAGE_BUGREPORT='http://github.com/neurobin/rnm/issues' PACKAGE_URL='' @@ -1275,7 +1275,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rnm 3.2.3 to adapt to many kinds of systems. +\`configure' configures rnm 3.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1341,7 +1341,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rnm 3.2.3:";; + short | recursive ) echo "Configuration of rnm 3.3.0:";; esac cat <<\_ACEOF @@ -1434,7 +1434,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rnm configure 3.2.3 +rnm configure 3.3.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1895,7 +1895,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rnm $as_me 3.2.3, which was +It was created by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2763,7 +2763,7 @@ fi # Define the identity of the package. PACKAGE='rnm' - VERSION='3.2.3' + VERSION='3.3.0' cat >>confdefs.h <<_ACEOF @@ -5396,7 +5396,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rnm $as_me 3.2.3, which was +This file was extended by rnm $as_me 3.3.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5453,7 +5453,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rnm config.status 3.2.3 +rnm config.status 3.3.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f60992b..c14ec47 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rnm], [3.2.3], [http://github.com/neurobin/rnm/issues]) +AC_INIT([rnm], [3.3.0], [http://github.com/neurobin/rnm/issues]) AC_CONFIG_AUX_DIR(config) prefix="/usr" AC_CONFIG_SRCDIR([src/main.cpp]) diff --git a/m4/New Empty File b/m4/New Empty File new file mode 100644 index 0000000..e69de29 diff --git a/man.html b/man.html index 4ac5c04..fbb4f47 100644 --- a/man.html +++ b/man.html @@ -1,8 +1,7 @@ - Man page of rnm

rnm

-Section: Utility (1)
Updated: Sat Nov 21 2015
+Section: Utility (1)
Updated: Sat Dec 19 2015

 

Index

@@ -12,14 +11,14 @@

rnm

OPTIONS
TERMINOLOGY
EXAMPLES
-
LOGDIR
-
EXITSTATUS
-
BUGREPORT
-
AUTHOR
-
WEB
+
LIMITS
+
LOGDIR
+
EXITSTATUS
+
BUGREPORT
+
AUTHOR
+
WEB

-  

NAME

@@ -68,7 +67,7 @@

DESCRIPTION

Bulk Rename Utility written in C++. Files and directories can be passed as command line arguments to rename them in bulk according to some naming scheme ( Name String -). If no file or directory path is passed as command line argument, it will wait for user to type the path i.e it will take the path from standard input (>=version 3.0.1). It uses ECMAScript regex as the default regex to provide search (and replace) functionality, other regex modes ( POSIX compliant basic and extended regex) are available through ( +). If no file or directory path is passed as command line argument, it will wait for user to type the path i.e it will take the path from standard input (>=version 3.0.1). It uses ECMAScript regex (aka JavaScript) as the default regex to provide search (and replace) functionality, other regex modes ( POSIX compliant basic and extended regex) are available through ( -re ) option. It provides an undo functionality ( @@ -119,6 +118,31 @@

OPTIONS

value : The amount line count will be incremented or decremented in each iteration. This is always a positive integer. +

+

--index-flags,
+-if + +flags + +: This sets Index flags. This is a '/' separated list of flags that will be used to render the index within it's text field. +

+The general format is +'/keyword1/keyword2/...' + +

+Valued flags are set with +keyword=value + +format. +

+Ex: +-if + +'/uppercase/showpoint/showpos/showbase/left/length=4/precision=3/filler=*/latin-fallback=687678/' + +

+See keywords section for details. +

--index-field-length,
-ifl @@ -130,35 +154,30 @@

OPTIONS

). iff is set to the character 0 -by default. +by default. This can also be set using the +-if + +option. The keyword is 'length'.

--index-field-filler,
-iff single-character -: Not occupied field in index will be filled with a character which is set by this option. +: Not occupied field in index will be filled with a character which is set by this option. This can also be set using the +-if + +option. The keyword is 'filler'.

--index-field-precision,
-ifp value -: Index is a floating point decimal value. This sets the precision. If it is less than the number of digits left of the decimal point, the indexes may be rendered in scientific format.This option only sets the precision value. The result may be confusing and you shouldn't use this option unless you know what you are doing. Make it specific with `-ifp/d` or `-ifp/s` which set type of format (fixed point or scientific) along with the precision value. -

-

--index-field-decimal-precision,
--ifp/d +: Index is a floating point decimal value. This sets the precision. If it is less than the number of digits left of the decimal point, the indexes may be rendered in scientific format.This option only sets the precision value. The result may be confusing and you shouldn't use this option unless you know what you are doing. This can also be set using the +-if -value - -: This sets the decimal precision i.e the number of digits that would be taken after the decimal point. If this option is passed other types of precisions will be ignored (if passed alongside). Mind that only the type is ignored not the value i.e the precision value will be overwritten always. -

-

--index-field-scientific-precision,
--ifp/s - -value - -: This sets the scientific precision. All indexes will be rendered in scientific form. +option. The keyword is 'precision'.

--name-string,
-ns @@ -386,7 +405,7 @@

TERMINOLOGY

A string, that is parsed to create names for new files. It can be fixed name which then can be modified for different files at runtime. Name sting is parsed by the following rules (must be wrapped around with filepath delimiter /): -
+

/n/ @@ -449,6 +468,67 @@

TERMINOLOGY

/-idr/ etc..) in the above replacement rules (applies to indexes excluding line index) will mean inverse index conforming to their meaning. +

+

+ +

+Extended Name String Rule + +

+This is an extension of the general purpose name string rules mentioned above. +

+Base conversion + +

+/i-b2/ + +converts the index to base 2 i.e binary and +/i-b32/ + +will convert to base 32. This applies to all numbered name string rules. +
+ +

+Latin conversion + +

+/i-l/ + +converts the index to Latin number. This applies to all numbered name string rules. +
+ +

+Scientific conversion + +

+/i-s/ + +converts the index to scientific form. This applies to all numbered name string rules. +
+ +

+Extended /pd/ rules + +

+pd0 is the immediate parent directory, pd1 is the directory before pd0 and so forth. +

+A range can also be supplied to combine all the directories in the level implied by the range. The general format of this rule is +/pd<digits>-<digits>-delimiter/ + +

+For example: +/pd0-4--/ + +will combine all directories from level 0 to 4 inserting the delimiter (- in this case) between them and the rule will become something like dir0-dir1-dir2-dir3-dir4. +

+In place of <digits> you can also supply 'e' which generally means the 'end' i.e the deepest level available. +

+Any unavailable level of directory will be ignored and be replaced with empty string. +

+The range is bidirectional e.g +/pd4-0--/ + +will do the same in reverse order.

@@ -560,7 +640,7 @@

TERMINOLOGY

& will be taken as the entire match found by the regex (search_part).

-\1, \2 etc.. is the back-references, i.e you can access captured groups with these back-references. Up-to two digits after the \ will be taken as a back-reference. If you want to isolate a back-reference make it fill up the two digit limit or wrap it around with {}. For example, if you want to put a digit (2) after back-reference \1, you can't use it like \12. \12 will mean 12th back-reference not \1 appended with a digit (1). In this case either use \01 instead of \1 or isolate the back-reference with {} i.e \{1}. +\1, \2 etc.. is the captured groups or subpatterns. Up-to two digits after the \ will be taken as a captured group. If you want to isolate a captured group, wrap it around with {}. For example, if you want to put a digit (2) after the subpattern \1, you can't use it like \12. \12 will mean 12th subpattern not \1 appended with a digit (1). In this case isolate the subpattern with {} i.e \{1}.

\c to convert to lowercase and \C to convert to uppercase. No other character is allowed in replace_part if \c or \C is used.

@@ -636,6 +716,57 @@

TERMINOLOGY

option.
+

+Keywords + +

+uppercase + +: means uppercase. +

+showpoint + +: show point regardless if it's an integer or floating point value. +

+showbase + +: means show base (Hex or Oct). +

+showpos + +: show + sign for positive numbers. +

+right + +: adjust right. +

+left + +: adjust left. +

+internal + +: adjust internal. +

+precision + +: set precision. Used like +precision=value + +

+length + +: sets length. Used like +length=value + +

+filler + +: sets filler. Used like +filler=value + +

+

Only invalid characters for a file or directory name is the path delimiter and the null character (\0).

@@ -685,17 +816,28 @@

EXAMPLES

file only mode, i.e no directory will be renamed or indexed, unless depth is >0 -

  +

LIMITS

+ +

+Maximum length of file name/path + +: FILENAME_MAX +

+Default latin fallback + +: 55555 (After this value latin conversion will fall back to decimal). +

+ 

LOGDIR

~/.neurobin/rnm

-  + 

EXITSTATUS

@@ -703,11 +845,11 @@

EXITSTATUS

1 on failure

-  + 

BUGREPORT

Report bugs to http://github.com/neurobin/rnm/issues -  + 

AUTHOR

@@ -715,15 +857,15 @@

AUTHOR

@github: http://github.com/neurobin
@bitbucket: http://bitbucket.com/neurobin
-  + 

WEB

http://neurobin.github.io/rnm

- -


-This document was created by man2html
-Time: 06:57:16 GMT, November 21, 2015 +This document was created by +man2html, +using the manual pages.
+Time: 20:59:37 GMT, December 18, 2015 diff --git a/rnm.1 b/rnm.1 index feae814..59542f1 100644 --- a/rnm.1 +++ b/rnm.1 @@ -1,4 +1,4 @@ -.TH rnm 1 "Sat Nov 21 2015" Unix "Utility" +.TH rnm 1 "Sat Dec 19 2015" Unix "Utility" .SH NAME rnm \- Bulk rename utility .SH SYNOPSIS @@ -28,7 +28,7 @@ are the same. .SH DESCRIPTION Bulk Rename Utility written in C++. Files and directories can be passed as command line arguments to rename them in bulk according to some naming scheme ( .B Name String -). If no file or directory path is passed as command line argument, it will wait for user to type the path i.e it will take the path from standard input (>=version 3.0.1). It uses ECMAScript regex as the default regex to provide search (and replace) functionality, other regex modes ( POSIX compliant basic and extended regex) are available through ( +). If no file or directory path is passed as command line argument, it will wait for user to type the path i.e it will take the path from standard input (>=version 3.0.1). It uses ECMAScript regex (aka JavaScript) as the default regex to provide search (and replace) functionality, other regex modes ( POSIX compliant basic and extended regex) are available through ( .B -re ) option. It provides an undo functionality ( .B rnm -u @@ -62,6 +62,25 @@ etc.. .B -linc .I value : The amount line count will be incremented or decremented in each iteration. This is always a positive integer. + +.IP "--index-flags," +.B -if +.I flags +: This sets Index flags. This is a '/' separated list of flags that will be used to render the index within it's text field. + +The general format is +.I '/keyword1/keyword2/...' + +Valued flags are set with +.I keyword=value +format. + +Ex: +.B -if +.I '/uppercase/showpoint/showpos/showbase/left/length=4/precision=3/filler=*/latin-fallback=687678/' + +See keywords section for details. + .IP --index-field-length, .B -ifl .I value @@ -69,27 +88,23 @@ etc.. .B -iff ). iff is set to the character .I 0 -by default. +by default. This can also be set using the +.B -if +option. The keyword is 'length'. .IP "--index-field-filler," .B -iff .I single-character -: Not occupied field in index will be filled with a character which is set by this option. +: Not occupied field in index will be filled with a character which is set by this option. This can also be set using the +.B -if +option. The keyword is 'filler'. .IP "--index-field-precision," .B -ifp .I value -: Index is a floating point decimal value. This sets the precision. If it is less than the number of digits left of the decimal point, the indexes may be rendered in scientific format.This option only sets the precision value. The result may be confusing and you shouldn't use this option unless you know what you are doing. Make it specific with `-ifp/d` or `-ifp/s` which set type of format (fixed point or scientific) along with the precision value. - -.IP "--index-field-decimal-precision," -.B -ifp/d -.I value -: This sets the decimal precision i.e the number of digits that would be taken after the decimal point. If this option is passed other types of precisions will be ignored (if passed alongside). Mind that only the type is ignored not the value i.e the precision value will be overwritten always. - -.IP "--index-field-scientific-precision," -.B -ifp/s -.I value -: This sets the scientific precision. All indexes will be rendered in scientific form. +: Index is a floating point decimal value. This sets the precision. If it is less than the number of digits left of the decimal point, the indexes may be rendered in scientific format.This option only sets the precision value. The result may be confusing and you shouldn't use this option unless you know what you are doing. This can also be set using the +.B -if +option. The keyword is 'precision'. .IP --name-string, .B -ns @@ -256,7 +271,7 @@ Decrementing index. .B Name String .RS A string, that is parsed to create names for new files. It can be fixed name which then can be modified for different files at runtime. Name sting is parsed by the following rules (must be wrapped around with filepath delimiter /): -.RS + .B /n/ in name string will be replaced with filename without extension. If used with -nsf option, the filename will be the name taken from the Name String File. @@ -303,6 +318,51 @@ In general, .B /-ir/ .B /-idr/ etc..) in the above replacement rules (applies to indexes excluding line index) will mean inverse index conforming to their meaning. + +.RE + +.B Extended Name String Rule +.RS +This is an extension of the general purpose name string rules mentioned above. + +.B Base conversion +.RS +.B /i-b2/ +converts the index to base 2 i.e binary and +.B /i-b32/ +will convert to base 32. This applies to all numbered name string rules. +.RE + +.B Latin conversion +.RS +.B /i-l/ +converts the index to Latin number. This applies to all numbered name string rules. +.RE + +.B Scientific conversion +.RS +.B /i-s/ +converts the index to scientific form. This applies to all numbered name string rules. +.RE + +.B Extended /pd/ rules +.RS +pd0 is the immediate parent directory, pd1 is the directory before pd0 and so forth. + +A range can also be supplied to combine all the directories in the level implied by the range. The general format of this rule is +.B /pd--delimiter/ + +For example: +.B /pd0-4--/ +will combine all directories from level 0 to 4 inserting the delimiter (- in this case) between them and the rule will become something like dir0-dir1-dir2-dir3-dir4. + +In place of you can also supply 'e' which generally means the 'end' i.e the deepest level available. + +Any unavailable level of directory will be ignored and be replaced with empty string. + +The range is bidirectional e.g +.B /pd4-0--/ +will do the same in reverse order. .RE .RE @@ -381,7 +441,7 @@ Regarding the & will be taken as the entire match found by the regex (search_part). -\\1, \\2 etc.. is the back-references, i.e you can access captured groups with these back-references. Up-to two digits after the \\ will be taken as a back-reference. If you want to isolate a back-reference make it fill up the two digit limit or wrap it around with {}. For example, if you want to put a digit (2) after back-reference \\1, you can't use it like \\12. \\12 will mean 12th back-reference not \\1 appended with a digit (1). In this case either use \\01 instead of \\1 or isolate the back-reference with {} i.e \\{1}. +\\1, \\2 etc.. is the captured groups or subpatterns. Up-to two digits after the \\ will be taken as a captured group. If you want to isolate a captured group, wrap it around with {}. For example, if you want to put a digit (2) after the subpattern \\1, you can't use it like \\12. \\12 will mean 12th subpattern not \\1 appended with a digit (1). In this case isolate the subpattern with {} i.e \\{1}. \\c to convert to lowercase and \\C to convert to uppercase. No other character is allowed in replace_part if \\c or \\C is used. @@ -437,6 +497,42 @@ or option. .RE +.B Keywords +.RS +.B uppercase +: means uppercase. + +.B showpoint +: show point regardless if it's an integer or floating point value. + +.B showbase +: means show base (Hex or Oct). + +.B showpos +: show + sign for positive numbers. + +.B right +: adjust right. + +.B left +: adjust left. + +.B internal +: adjust internal. + +.B precision +: set precision. Used like +.I precision=value + +.B length +: sets length. Used like +.I length=value + +.B filler +: sets filler. Used like +.I filler=value +.RE + Only invalid characters for a file or directory name is the path delimiter and the null character (\\0). .SH EXAMPLES @@ -471,6 +567,13 @@ is the index i.e files and directories get indexed ( file only mode, i.e no directory will be renamed or indexed, unless depth is .B >0 +.SH LIMITS + +.B Maximum length of file name/path +: FILENAME_MAX + +.B Default latin fallback +: 55555 (After this value latin conversion will fall back to decimal). .SH LOGDIR diff --git a/rnm.1.gz b/rnm.1.gz index 58e9c2d..2ba2199 100644 Binary files a/rnm.1.gz and b/rnm.1.gz differ diff --git a/src/Makefile.in b/src/Makefile.in index 196addd..0878934 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -251,7 +251,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -rnm_SOURCES = main.cpp globals.hpp classes.hpp funcs.hpp +rnm_SOURCES = main.cpp globals.hpp classes.hpp funcs.hpp strnatcmp.hpp prototypes.hpp all: all-am .SUFFIXES: diff --git a/src/globals.hpp b/src/globals.hpp index 5c606a6..c29c5ca 100644 --- a/src/globals.hpp +++ b/src/globals.hpp @@ -103,7 +103,6 @@ typedef std::map StringintMap; #define REGEX_DEFAULT REGEX_ECMASCRIPT #define REGEX_LOCALE std::regex::collate -#define PCRE2_CODE_UNIT_WIDTH 8 #define print std::cout<< #define printe std::cerr<< #define ENDL std::endl @@ -212,7 +211,7 @@ int IFP=-1; //index field precision ///////Index flags management -std::map index_int_flag={{"precision",IFP},{"width",index_field_length},{"latin-fallback",latin_fall_back_threshold}}; +std::map index_int_flag={{"precision",IFP},{"length",index_field_length},{"latin-fallback",latin_fall_back_threshold}}; std::map index_string_flag={{"filler",IFF}}; String IFP_s="unset"; @@ -325,7 +324,6 @@ options:\n\ -linc value : The amount line count will be incremented or decremented in each iteration.\n\ This is always a positive integer.\n\ \n\ - This can also be set with the -if option.\n\ -if value : This sets Index flags. This is a "+path_delim+" separated list of flags\n\ that will be used to render the index within it's text field.\n\ \n\ diff --git a/src/main b/src/main index 64b2b33..606ea3a 100644 Binary files a/src/main and b/src/main differ