Commits

Sam Adams committed 38ba668

Remove options from command invokation

  • Participants
  • Parent commits 0b0001b

Comments (0)

Files changed (8)

File client-cli/src/main/java/net/chempound/client/cli/ChempoundClientCLI.java

     }
 
     protected void invokeCommand(final Command command) {
-        command.invoke(globalOptions, command.getOptions());
+        command.invoke(globalOptions);
     }
 
     protected void exitWithError(final ParameterException e) {

File client-cli/src/main/java/net/chempound/client/cli/command/Command.java

  */
 public interface Command<T> {
 
-    void invoke(GlobalOptions globalOptions, T options);
+    void invoke(GlobalOptions globalOptions);
 
     T getOptions();
 

File client-cli/src/main/java/net/chempound/client/cli/command/CopyCommand.java

     }
 
     @Override
-    public void invoke(final GlobalOptions globalOptions, final CopyOptions options) {
+    public void invoke(final GlobalOptions globalOptions) {
         throw new UnsupportedOperationException();
     }
 

File client-cli/src/main/java/net/chempound/client/cli/command/DeleteCommand.java

     }
 
     @Override
-    public void invoke(final GlobalOptions globalOptions, final DeleteOptions options) {
+    public void invoke(final GlobalOptions globalOptions) {
         throw new UnsupportedOperationException();
     }
 

File client-cli/src/main/java/net/chempound/client/cli/command/DepositCommand.java

  */
 public class DepositCommand implements Command<DepositOptions> {
 
-    private final DepositOptions depositOptions = new DepositOptions();
+    protected final DepositOptions depositOptions;
+
+    public DepositCommand() {
+        this(new DepositOptions());
+    }
+
+    protected DepositCommand(final DepositOptions depositOptions) {
+        this.depositOptions = depositOptions;
+    }
 
     @Override
     public DepositOptions getOptions() {
         return depositOptions;
     }
 
-    public void invoke(final GlobalOptions globalOptions, final DepositOptions depositOptions) {
+    @Override
+    public void invoke(final GlobalOptions globalOptions) {
 
         final DepositBuilder depositBuilder = new DepositBuilder();
 

File client-cli/src/main/java/net/chempound/client/cli/command/ExportCommand.java

     }
 
     @Override
-    public void invoke(final GlobalOptions globalOptions, final ExportOptions options) {
+    public void invoke(final GlobalOptions globalOptions) {
         throw new UnsupportedOperationException();
     }
 

File client-cli/src/main/java/net/chempound/client/cli/command/HelpCommand.java

     }
 
     @Override
-    public void invoke(final GlobalOptions globalOptions, final HelpOptions options) {
+    public void invoke(final GlobalOptions globalOptions) {
         throw new UnsupportedOperationException();
     }
 

File client-cli/src/main/java/net/chempound/client/cli/command/MoveCommand.java

     }
 
     @Override
-    public void invoke(final GlobalOptions globalOptions, final MoveOptions options) {
+    public void invoke(final GlobalOptions globalOptions) {
         throw new UnsupportedOperationException();
     }