comparison src/viewer_swing/java/com/glavsoft/viewer/cli/Parser.java @ 52:472a9bcacb21 draft default tip

TightVNC 2.7.1.0
author you@cr.ie.u-ryukyu.ac.jp
date Wed, 07 Aug 2013 19:01:17 +0900
parents 4689cc86d6cb
children
comparison
equal deleted inserted replaced
0:4689cc86d6cb 52:472a9bcacb21
1 // Copyright (C) 2010, 2011 GlavSoft LLC. 1 // Copyright (C) 2010, 2011, 2012, 2013 GlavSoft LLC.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 //------------------------------------------------------------------------- 4 //-------------------------------------------------------------------------
5 // This file is part of the TightVNC software. Please visit our Web site: 5 // This file is part of the TightVNC software. Please visit our Web site:
6 // 6 //
22 //------------------------------------------------------------------------- 22 //-------------------------------------------------------------------------
23 // 23 //
24 24
25 package com.glavsoft.viewer.cli; 25 package com.glavsoft.viewer.cli;
26 26
27 import com.glavsoft.utils.Strings;
28
27 import java.util.ArrayList; 29 import java.util.ArrayList;
28 import java.util.LinkedHashMap; 30 import java.util.LinkedHashMap;
29 import java.util.List; 31 import java.util.List;
30 import java.util.Map; 32 import java.util.Map;
31
32 import com.glavsoft.utils.Strings;
33 33
34 /** 34 /**
35 * Command line interface parameters parser 35 * Command line interface parameters parser
36 */ 36 */
37 public class Parser { 37 public class Parser {
68 return op != null ? op.value : null; 68 return op != null ? op.value : null;
69 } 69 }
70 70
71 public boolean isSet(String param) { 71 public boolean isSet(String param) {
72 Option op = options.get(param.toLowerCase()); 72 Option op = options.get(param.toLowerCase());
73 return op != null ? op.isSet : false; 73 return op != null && op.isSet;
74 } 74 }
75 75
76 public boolean isSetPlainOptions() { 76 public boolean isSetPlainOptions() {
77 return isSetPlainOptions; 77 return isSetPlainOptions;
78 } 78 }
87 87
88 /** 88 /**
89 * Command line interface option 89 * Command line interface option
90 */ 90 */
91 private static class Option { 91 private static class Option {
92 @SuppressWarnings("unused")
93 protected String opName, defaultValue, desc, value; 92 protected String opName, defaultValue, desc, value;
94 protected boolean isSet = false; 93 protected boolean isSet = false;
95 public Option(String opName, String defaultValue, String desc) { 94 public Option(String opName, String defaultValue, String desc) {
96 this.opName = opName; 95 this.opName = opName;
97 this.defaultValue = defaultValue; 96 this.defaultValue = defaultValue;