File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,6 @@ fn check_conflict(path: &Path) -> bool {
170170}
171171
172172fn main ( ) {
173- // parsing the args
174173 let args = Args :: parse ( ) ;
175174
176175 let paths = args. get_items ( ) ;
@@ -179,6 +178,14 @@ fn main() {
179178 let dir = args. dir ;
180179 let permanent = args. permanent ;
181180
181+ // Handling the case where no paths are provided and no subcommand is used
182+ if paths. is_empty ( ) && args. command . is_none ( ) {
183+ eprintln ! ( "{}" , "rmxt: missing operand" . red( ) ) ;
184+ eprintln ! ( "{}" , "Try 'rmxt --help' for more information." . yellow( ) ) ;
185+ return ;
186+ }
187+
188+ // purging files from trash if the purge command is used
182189 if args. is_purge ( ) {
183190 let names = args. get_purge_name ( ) ;
184191 let content_to_purge = match trash:: os_limited:: list ( ) {
@@ -200,6 +207,7 @@ fn main() {
200207 }
201208 }
202209
210+ // recovering all files from trash if the recover-all command is used
203211 if args. is_recover_all ( ) {
204212 let seconds = args. get_time_recover ( ) * 86400 ;
205213 let mut content_to_recover = vec ! [ ] ;
You can’t perform that action at this time.
0 commit comments