File tree 4 files changed +10
-1
lines changed
4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ The new file name does not need to contain a file extension. If you do not speci
26
26
``` -s ``` , ``` --sim ``` : Simulate rename and just print new file names
27
27
``` -n ``` , ``` --noindex ``` : Do not append an index when renaming multiple files. Use with caution.
28
28
``` -v ``` , ``` --verbose ``` : Print all rename operations completed. Prints the same information as the -s option but goes through with the renames.
29
+ ``` --notrim ``` : Do not trim whitespace at beginning or end of ouput file name
29
30
``` -h ``` , ``` --help ``` : Show help
30
31
31
32
### Variables
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ const argv = yargs
51
51
alias : 'verbose' ,
52
52
boolean : true ,
53
53
describe : 'Print all rename operations completed'
54
+ } , 'notrim' : {
55
+ boolean : true ,
56
+ describe : 'Do not trim whitespace at beginning or end of ouput file name'
54
57
}
55
58
} )
56
59
. help ( 'help' )
Original file line number Diff line number Diff line change @@ -87,6 +87,11 @@ module.exports = {
87
87
fileObj . newName = fileObj . newName + replacements . i . function ( fileObj , '1' ) ;
88
88
}
89
89
90
+ // TRIM output file name unless --notrim option used
91
+ if ( ! args . notrim ) {
92
+ fileObj . newName = fileObj . newName . trim ( ) ;
93
+ }
94
+
90
95
let operationText = fileObj . base + ' → ' + fileObj . newName + fileObj . newNameExt ;
91
96
92
97
if ( args . s ) { // SIMULATED if argument --s just print what the output would be
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " rename-cli" ,
3
- "version" : " 2.3 .0" ,
3
+ "version" : " 2.4 .0" ,
4
4
"description" : " A command line utility for renaming files" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments