jcplaboratory / rashell

Rashell is Bash-like command processor for Windows
https://opensource.jcplaboratory.org/rashell
GNU General Public License v3.0
12 stars 2 forks source link

new command : del #15

Closed cynferdd closed 5 years ago

cynferdd commented 5 years ago

Adding the del command to delete a file or many files. Works with wildcards. a bit of cleaning and simplification was done on some methods. TODO : the following parameters are not yet implemented : /F => Force deleting of read - only files. /S => Delete specified files from all subdirectories. /A => Selects files to delete based on attributes

cedroid09 commented 5 years ago

This is great! I'm happy to see contributions toward Rashell.

Just one thing!

Can we rename the command from del to rm instead? The objective is to bring a sort of Linux feel to Windows.

cedroid09 commented 5 years ago

I did the required modifications.


Another thing I've noticed is that arguments are not being processed within the main method. This is problematic in the case or rm. For instance, rm --help should have returned "Invalid argument" instead of "Deleting --help". Taking care of arguments before parsing them to the operating method prevents that kind of error.

Thanks again.

cynferdd commented 5 years ago

Thanks a lot for the feedback, I'll try to keep that in mind for the next iterations :) . So if the need is to get a more "linux" feel, should I change the arguments from /P to -P (for example) ? Or maybe allow both ways ?

cedroid09 commented 5 years ago

Let's allow both ways. If you'd have a look at for code for "ls" you'll see how this is being taken care of.

Sorry for my unconventional coding methods in advance. Looking forward to your future PRs. :)