Permalink
Browse files

[HHQ-4150] Make --count optional when listing alerts via the CLI.

  • Loading branch information...
1 parent f887e9d commit c8a89c90a148a5a67d5e3cde7aa1606c2afec9ab Ryan Morgan committed Jul 19, 2010
Showing with 9 additions and 3 deletions.
  1. +2 −0 ChangeLog
  2. +7 −3 src/org/hyperic/hq/hqapi1/tools/AlertCommand.java
View
@@ -1,6 +1,8 @@
Changes in HQApi 2.6
+ *) [HHQ-4150] Make --count optional when listing alerts via the CLI.
+
*) [HHQ-4145] Add --addRole, --removeRole, and --clearRoles options to
command line group syncing. These can only be used with --name.
@@ -104,7 +104,7 @@ private void list(String[] args) throws Exception {
withRequiredArg().ofType(Long.class);
p.accepts(OPT_END, "If specified, the end time in epoch-millis.").
withRequiredArg().ofType(Long.class);
- p.accepts(OPT_COUNT, "The maximum number of alerts to return.")
+ p.accepts(OPT_COUNT, "If specified, the maximum number of alerts to return.")
.withRequiredArg().ofType(Integer.class);
p.acceptsAll(Arrays.asList(OPT_INESC),
"If specified, only return alerts which are in " +
@@ -132,8 +132,12 @@ private void list(String[] args) throws Exception {
end = System.currentTimeMillis();
}
- // --count is required
- Integer count = (Integer)getRequired(options, OPT_COUNT);
+ Integer count;
+ if (options.has(OPT_COUNT)) {
+ count = (Integer)getRequired(options, OPT_COUNT);
+ } else {
+ count = Integer.MAX_VALUE;
+ }
Boolean inEsc = options.has(OPT_INESC[0]);
Boolean notFixed = options.has(OPT_NOTFIXED[0]);

0 comments on commit c8a89c9

Please sign in to comment.