You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@batchee.apache.org by rm...@apache.org on 2015/11/30 18:25:43 UTC
incubator-batchee git commit: adding to CliConfiguration the ability
to decorate the command
Repository: incubator-batchee
Updated Branches:
refs/heads/master aa0914c6a -> 99972657e
adding to CliConfiguration the ability to decorate the command
Project: http://git-wip-us.apache.org/repos/asf/incubator-batchee/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-batchee/commit/99972657
Tree: http://git-wip-us.apache.org/repos/asf/incubator-batchee/tree/99972657
Diff: http://git-wip-us.apache.org/repos/asf/incubator-batchee/diff/99972657
Branch: refs/heads/master
Commit: 99972657e9547610de727041c9e4e6870e6e5a66
Parents: aa0914c
Author: Romain Manni-Bucau <rm...@gmail.com>
Authored: Mon Nov 30 18:23:01 2015 +0100
Committer: Romain Manni-Bucau <rm...@gmail.com>
Committed: Mon Nov 30 18:23:01 2015 +0100
----------------------------------------------------------------------
.../cli/src/main/java/org/apache/batchee/cli/BatchEECLI.java | 7 ++++++-
.../java/org/apache/batchee/cli/command/CliConfiguration.java | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/99972657/tools/cli/src/main/java/org/apache/batchee/cli/BatchEECLI.java
----------------------------------------------------------------------
diff --git a/tools/cli/src/main/java/org/apache/batchee/cli/BatchEECLI.java b/tools/cli/src/main/java/org/apache/batchee/cli/BatchEECLI.java
index a749fc9..f915760 100644
--- a/tools/cli/src/main/java/org/apache/batchee/cli/BatchEECLI.java
+++ b/tools/cli/src/main/java/org/apache/batchee/cli/BatchEECLI.java
@@ -97,6 +97,11 @@ public class BatchEECLI {
}
return classes.iterator();
}
+
+ @Override
+ public Runnable decorate(final Runnable task) {
+ return task;
+ }
};
final Cli.CliBuilder<Runnable> builder = Cli.<Runnable>builder(cliConfiguration.name())
@@ -120,7 +125,7 @@ public class BatchEECLI {
final Cli<Runnable> parser = builder.build();
try {
- parser.parse(args).run();
+ cliConfiguration.decorate(parser.parse(args)).run();
} catch (final ParseException e) {
parser.parse("help").run();
} catch (final RuntimeException e) {
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/99972657/tools/cli/src/main/java/org/apache/batchee/cli/command/CliConfiguration.java
----------------------------------------------------------------------
diff --git a/tools/cli/src/main/java/org/apache/batchee/cli/command/CliConfiguration.java b/tools/cli/src/main/java/org/apache/batchee/cli/command/CliConfiguration.java
index ca6fad6..9028d3d 100644
--- a/tools/cli/src/main/java/org/apache/batchee/cli/command/CliConfiguration.java
+++ b/tools/cli/src/main/java/org/apache/batchee/cli/command/CliConfiguration.java
@@ -23,4 +23,5 @@ public interface CliConfiguration {
String description();
boolean addDefaultCommands();
Iterator<Class<? extends UserCommand>> userCommands();
+ Runnable decorate(Runnable task);
}