File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,15 +49,41 @@ def main():
4949 logging .getLogger ("hnap" ).setLevel (logging .DEBUG )
5050
5151 parser = argparse .ArgumentParser ()
52- parser .add_argument ("--hostname" , required = True )
52+ parser .add_argument (
53+ "--hostname" ,
54+ required = True ,
55+ metavar = "hostname" ,
56+ )
5357 parser .add_argument (
5458 "--password" ,
55- default = os .environ .get ("HNAP_PASSWORD" , "" ),
5659 required = True ,
60+ metavar = "password" ,
61+ default = os .environ .get ("HNAP_PASSWORD" , "" ),
62+ )
63+ parser .add_argument (
64+ "--username" ,
65+ default = "admin" ,
66+ metavar = "username" ,
67+ )
68+ parser .add_argument (
69+ "--call" ,
70+ nargs = 1 ,
71+ default = [],
72+ metavar = "MethodName" ,
73+ help = (
74+ "If you are calling a SOAP action you must pass, at least, "
75+ "`--param Module 1` and, maybe, `--param Controller 1`."
76+ ),
77+ )
78+ parser .add_argument (
79+ "--param" ,
80+ action = "append" ,
81+ nargs = 2 ,
82+ default = [],
83+ dest = "params" ,
84+ metavar = ("ParamName" , "Value" ),
85+ help = "Params to pass to call. Multiple params can be passed." ,
5786 )
58- parser .add_argument ("--username" , default = "admin" )
59- parser .add_argument ("--call" , nargs = 1 , default = [])
60- parser .add_argument ("--params" , nargs = 2 , action = "append" , default = [])
6187 args = parser .parse_args ()
6288
6389 if len (args .call ) > 1 :
You can’t perform that action at this time.
0 commit comments