rename-1.3-rename.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. --- a/rename.c
  2. +++ b/rename.c
  3. @@ -594,7 +594,7 @@
  4. } else {
  5. rs = rename(oldp, new);
  6. if (rs < 0)
  7. - perror("rename");
  8. + perror("renamexm");
  9. else if (attr & MOD_VERBO)
  10. printf("ok\n");
  11. @@ -628,8 +628,8 @@
  12. {
  13. char *help = "\
  14. -Usage: rename SOURCE DEST\n\
  15. - or: rename [OPTION] file ...\n\
  16. +Usage: renamexm SOURCE DEST\n\
  17. + or: renamexm [OPTION] file ...\n\
  18. Rename SOURCE to DEST, or substitute characters match the specified pattern\n\
  19. in the filename.\n\
  20. \n\
  21. --- a/rename.1
  22. +++ b/rename.1
  23. @@ -1,16 +1,16 @@
  24. .TH NAME SECTION
  25. .SH Name
  26. -rename \- file rename tool
  27. +renamexm \- file rename tool
  28. .SH SYNOPSIS
  29. -.B rename
  30. +.B renamexm
  31. .I OldName NewName
  32. .P
  33. -.B rename
  34. +.B renamexm
  35. .I [options] files ...
  36. .SH DESCRIPTION
  37. This
  38. -.I rename
  39. +.I renamexm
  40. is a quick and powerful tool for
  41. .I upcasing,
  42. @@ -276,5 +276,5 @@
  43. .SH EXAMPLES
  44. .TP
  45. -.I rename foo food
  46. +.I renamexm foo food
  47. Change file 'foo' to 'food', just like
  48. .I mv(1)
  49. @@ -282,23 +282,23 @@
  50. .TP
  51. -.I rename -lR *
  52. +.I renamexm -lR *
  53. To lowcase all filenames, directories and filenames and directories under
  54. subdirectories.
  55. .TP
  56. -.I rename -s/abc/xyz/gi *.c
  57. +.I renamexm -s/abc/xyz/gi *.c
  58. Substitute all 'abc' substrings appeared in C sources files with 'xyz',
  59. ignoring case.
  60. .TP
  61. -.I rename -vs/.c/.cpp/s *.c
  62. +.I renamexm -vs/.c/.cpp/s *.c
  63. Change C sources suffix to C++ sources suffix, with verbose information.
  64. .TP
  65. -.I rename -s/abc/12345/bi *
  66. +.I renamexm -s/abc/12345/bi *
  67. Find the last occurrence of 'abc' and replace it with '12345', ignoring case.
  68. .TP
  69. -.I rename -o guest -R /home/custom
  70. +.I renamexm -o guest -R /home/custom
  71. change the owner of the file '/home/custom' to 'guest'. The 'guest' should
  72. be an effective user in the current system. If '/home/custom' is a directory,
  73. @@ -306,5 +306,5 @@
  74. .TP
  75. -.I rename -s/^[A-Z].*file/nofile/r *
  76. +.I renamexm -s/^[A-Z].*file/nofile/r *
  77. The target substring starts with a capital letter, and ends with string 'file'.
  78. There are 0 or any numbers of characters between the capital letter and 'file'.
  79. @@ -312,5 +312,5 @@
  80. .TP
  81. -.I rename -s/^[A-Z].+file/nofile/eg *
  82. +.I renamexm -s/^[A-Z].+file/nofile/eg *
  83. Similar to last example, except it uses extended regular expression, such as
  84. the '+' metacharacter, and replaces all matching strings with 'nofile'.