- double timeout = 5;
- if (ns.getDouble("timeout") != null) {
- timeout = ns.getDouble("timeout");
- }
- var returnOnTimeout = true;
- if (timeout < 0) {
- returnOnTimeout = false;
- timeout = 3600;
- }
- boolean ignoreAttachments = ns.getBoolean("ignore_attachments");
+ @SuppressWarnings("unchecked")
+ private <T> T getValue(final Map<String, Variant<?>> stringVariantMap, final String field) {
+ return (T) stringVariantMap.get(field).getValue();
+ }
+
+ @Override
+ public void handleCommand(
+ final Namespace ns, final Manager m, final OutputWriter outputWriter
+ ) throws CommandException {
+ double timeout = ns.getDouble("timeout");
+ boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
+ m.setIgnoreAttachments(ignoreAttachments);