-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new features to Files.java, fixed issue #77
Conversation
…e.Files instead of traditional java.io.*)
…ch method, created a wrapper FilesCommand class
I think most of the option checking functions should be put into the new Command interface that you built; perhaps have an inherited Also, what do you mean by:
|
That it is not the best solution for options checking |
Ok. |
OK, I have two ideas:
@CommandAnnotation(name = { "rm", "delete" }, minOptions = 1, helpInfo = "help")
public static void remove(List<String> options) {
// ...
} The disadvantage here is that the |
I think the first idea sounds easier, but on the other hand the second option looks much cleaner and would be more readable. What do you think would be best? Personally I'm leaning towards 2. |
I think we can try the second one. |
Sounds good. 👍 I would like to merge the fixes you made, but you might have to create a new branch with those specific fixes and open a new PR, as I can't select the specific commits I want to merge. |
Ok. BTW, can we chat in slack ? |
Sure, if it's convenient for you! 😀 |
I'll go ahead and close this PR and wait for you to move the changes over. |
Important changes in
jterm.command.Files
:md()
(issue "dir md dirName" does not create the directory in the correct location #73)move()
method, that was requested in roadmapdelete()
andread()
methods. I'm usingjava.nio.*
instead ofjava.io.*
. The code just looks more cleanerFilesCommand
that hasminOptionsSize
,helpInfo
fields and overridden methodaccept()
that makes checks for minOptionsSize and prints help info if requested.Minor changes to
Jterm.java
This PR is not recommended to be merged (except bugfixes).
I just wanted to say that in my opinion we should somehow generalize the command execution, because it's a bit annoying to read/write code when in each method you have to check the
options
list for-h
option or if it is empty.Before:
After: