karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject git commit: KARAF-2795 Improved javadoc for @Option
Date Thu, 08 May 2014 10:54:02 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 7fb41c05e -> f1307836a


KARAF-2795 Improved javadoc for @Option


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/f1307836
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/f1307836
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/f1307836

Branch: refs/heads/master
Commit: f1307836a62d0bc586d3569003c588779da09431
Parents: 7fb41c0
Author: Christian Schneider <chris@die-schneider.net>
Authored: Thu May 8 12:53:55 2014 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Thu May 8 12:53:55 2014 +0200

----------------------------------------------------------------------
 .../java/org/apache/karaf/shell/api/action/Option.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/f1307836/shell/core/src/main/java/org/apache/karaf/shell/api/action/Option.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/api/action/Option.java b/shell/core/src/main/java/org/apache/karaf/shell/api/action/Option.java
index 97e7557..e416bca 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/api/action/Option.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/api/action/Option.java
@@ -25,6 +25,18 @@ import java.lang.annotation.Target;
 
 /**
  * Used to mark an optional named command line option who's name typically starts with "--"
or "-".
+ * This annotation can be applied to attributes of a class implementing an Action.
+ * <p>
+ * <h2>Example 1 (boolean option):</h2>
+ * <code>@Option(name="--force") boolean force;</code>
+ * <p>
+ * This will be represented as --force on the command line.
+ * <p>
+ * <h2>Example 2 (mandatory String option):</h2>
+ * <code>@Option(name="-name",required=true) String name;</code>
+ * <p>
+ * This will be represented as -name=<myname> on the command line and the command will
be rejected if the 
+ * option is not given. 
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.FIELD})


Mime
View raw message