File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,11 @@ def __init__(self):
70
70
self .parser .add_argument ("-dt" , "--date" , action = 'store_true' ,
71
71
help = "Organize files by creation date" )
72
72
73
- self .args = self .parser .parse_args ()
73
+ self .parser .add_argument ("-df" , "--dateformat" , type = str ,
74
+ help = "set the date format using YYYY, MM or DD" )
74
75
76
+ self .args = self .parser .parse_args ()
77
+ self .dateformat = 'YYYY-MM-DD'
75
78
self .formats = {}
76
79
self .dirconf = None
77
80
self .checkconfig ()
@@ -213,7 +216,10 @@ def main(self):
213
216
self .dirconf = os .path .join (os .getcwd (), DIRCONFFILE )
214
217
215
218
if self .args .date :
216
- self .classify_by_date ('YYYY-MM-DD' , output , directory )
219
+ if self .args .dateformat :
220
+ self .classify_by_date (self .args .dateformat , output , directory )
221
+ else :
222
+ self .classify_by_date (self .dateformat , output , directory )
217
223
elif os .path .isfile (self .dirconf ):
218
224
print ('Found config in current directory' )
219
225
if self .args .output :
You can’t perform that action at this time.
0 commit comments