com.vmware.vim25.mo.util.CommandLineParser.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vijava Show documentation
Show all versions of vijava Show documentation
Java API for accessing VMWare web services API
The newest version!
???? 2? *com/vmware/vim25/mo/util/CommandLineParser java/lang/Object optsEntered Ljava/util/HashMap; Signature 9Ljava/util/HashMap; userOpts builtInOpts <([Lcom/vmware/vim25/mo/util/OptionSpec;[Ljava/lang/String;)V Code
()V java/util/HashMap
builtinOptions
addOptions )([Lcom/vmware/vim25/mo/util/OptionSpec;)V
" # $
parseInput ([Ljava/lang/String;)V
& ' validate LineNumberTable LocalVariableTable this ,Lcom/vmware/vim25/mo/util/CommandLineParser; userOptions &[Lcom/vmware/vim25/mo/util/OptionSpec; args [Ljava/lang/String;
StackMapTable - /
4 6 5 #com/vmware/vim25/mo/util/OptionSpec 7 8
getOptionName ()Ljava/lang/String;
: < ; java/lang/String = > length ()I
4 @ A 8
getOptionDesc
4 C D 8
getOptionType
4 F G > getOptionRequired
I J K put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; M O N java/lang/System P Q out Ljava/io/PrintStream; S java/lang/StringBuilder U Option
R W X (Ljava/lang/String;)V
R Z [ \ append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ^ definition is not valid
R ` a 8 toString
c e d java/io/PrintStream f X println h "java/lang/IllegalArgumentException
g W i I m url o String q VI SDK URL to connect to
4 s t L(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V v userName x Username to connect to the host z password | "password of the corresponding user ~ config ? *Location of the VI perl configuration file ? protocol ? "Protocol used to connect to server ? server ? VI server to connect to ?
portNumber ? Port used to connect to server ? 443 ? servicePath ? &Service path used to connect to server ? sessionFile ? ,File containing session ID/cookie to utilize ? help ? 'Display user information for the script ?
ignorecert ? (Ignore the server certificate validation ? username ?
portnumber ? servicepath ? sessionfile %Lcom/vmware/vim25/mo/util/OptionSpec;
? ? $ getCmdArguments ? Exception running :
R ? [ ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder;
? ? ? keySet ()Ljava/util/Set; ? ? ?
java/util/Set ? ? iterator ()Ljava/util/Iterator; ? ? ? java/util/Iterator ? ? next ()Ljava/lang/Object;
`
? ? ? get &(Ljava/lang/Object;)Ljava/lang/Object;
? ? ? checkInputOptions ((Ljava/util/HashMap;Ljava/lang/String;)Z ? Invalid Input Option ' ? '
? ? displayUsage
? ? ? checkDatatypes :(Ljava/util/HashMap;Ljava/lang/String;Ljava/lang/String;)Z ? #Invalid datatype for Input Option ' ? ? ? ? hasNext ()Z ? java/lang/Exception e Ljava/lang/Exception; It Ljava/util/Iterator; keyValue Ljava/lang/String;
keyOptions result Z valid ? usage ? ? --
: ? ? ?
startsWith (Ljava/lang/String;)Z
: ? ? ? substring (I)Ljava/lang/String;
? ? ? containsKey (Ljava/lang/Object;)Z ? key ' ? ' already exists len val opt
validateDataType '(Ljava/lang/String;Ljava/lang/String;)Z Opts oSpec dataType Boolean
:
? equalsIgnoreCase true false Integer
java/lang/Integer parseInt (Ljava/lang/String;)I Float
java/lang/Float
parseFloat (Ljava/lang/String;)F Long
"$# java/lang/Long%& parseLong (Ljava/lang/String;)J( java/lang/NumberFormatException !Ljava/lang/NumberFormatException; checkOptions value
- '. '(Ljava/lang/Object;Ljava/lang/String;)V
01 ? isEmpty3 ---help
M567 exit (I)V
9: ?
option_is_set
<=> getValue '(Ljava/util/HashMap;)Ljava/util/Vector;
@BA java/util/Vector ?C (I)Ljava/lang/Object;E Enter password:
GHI readPassword &(Ljava/lang/String;)Ljava/lang/String;K ----ERROR: M not specified
cOP X print
@RS > sizeU SMust have one of command options 'sessionfile' or a 'username' and 'password' pair
className Ljava/lang/Object; functionName vec Ljava/util/Vector;
missingArg LocalVariableTypeTable &Ljava/util/Vector;
@
@`a ? add strd Common Java Options :
fgh
print_options (Ljava/util/HashMap;)Vj
Command specific options:
4lm 8 getOptionDefaulto --q < type s
, default u >w < default y >{ } type
defaultVal generalKeys Ljava/util/Set;
:?? ? equals option keyVal
get_option
: `? undefined variable key getOnelineInput? java/io/BufferedReader? java/io/InputStreamReader M??? in Ljava/io/InputStream;
?? ? (Ljava/io/InputStream;)V
?? ? (Ljava/io/Reader;)V
??? 8 readLine? Error in reading console input.? java/io/IOException prompt stdin Ljava/io/BufferedReader; pass ioe Ljava/io/IOException; getUsername
??I getPassword? 7com/vmware/vim25/mo/util/CommandLineParser$PasswordMask
?? ? /(Lcom/vmware/vim25/mo/util/CommandLineParser;)V
??? start
??? halt?
consoleEraser 9Lcom/vmware/vim25/mo/util/CommandLineParser$PasswordMask;
SourceFile CommandLineParser.java InnerClasses PasswordMask !
? H*? *? Y? ? *? Y? ? *? Y? ? *? +? *+? *,? !*? %? *,? !*? %? ( 2 . * + , % 0 ) 2 - 4 2 5 7 6 > : C ; G = ) H * + H , - H . / 0 ? > 1 2
8 ?=? ?+2? 3? c+2? 3? 9? W+2? ?? N+2? ?? 9? B+2? B? 9+2? B? 9? -+2? E? +2? 3? 9? *? +2? 3+2? HW? E? L? RYT? V+2? 3? Y]? Y? _? b? gY? RYT? V+2? 3? Y]? Y? _? i??+???O? ( 2 B D E / F D G Z H n L ? M ? N ? M ? B ? Q ) ? * + ? , - ? j k 0 ? ? T? A
: F? 4Ylnp? rL? 4Yunw? rM? 4Yyn{? rN? 4Y}n? r:? 4Y?n?? r:? 4Y?n?? r:? 4Y?n??? r:? 4Y?n?? r:? 4Y?n?? r: ? 4Y?n?? r:
? 4Y?n?? r:*? l+? HW*? ?,? HW*? y-? HW*? y-? HW*? }? HW*? ?? HW*? ?? HW*? ?? HW*? ?? HW*? ? ? HW*? ?
? HW*? ?? HW? ( b U V W 0 X A Y R Z c [ u \ ? ] ? ^ ? _ ? ` ? a ? b ? c ? d ? e ? f g h! i- j9 kE l ) z F * + 6 m ? &