2

OptionParser を使用して次のオプションがあります

parser = OptionParser()
parser.add_option("-submitted.cl", "--change_list", dest="change_list",help="Submitted Change list")
parser.add_option("-submitted.cr", "--crlist", dest="cr_list",help="Submitted CR list")
parser.add_option("-build.location", "--sbl", dest="sbl",help="Source build location")
parser.add_option("-filer.location", "--dbl", dest="dbl",help="Filer location")
parser.add_option("-users", "--users",dest="users",help="Users")
(options, args) = parser.parse_args()

次のオプションを使用してスクリプトを実行していますが、次のエラーが発生します。修正方法を入力してください。

python save_build_artifacts.py 12345 02384 \\ben\cnss_dev_integration\nfc_builds\LA_host_builds\8084\Build2  \\ben\cnss_dev_integration\temp gnakkala

エラー:-

Traceback (most recent call last):
  File "save_build_artifacts.py", line 75, in <module>
    main()
  File "save_build_artifacts.py", line 43, in main
    parser.add_option("-submitted.cl", "--change_list", dest="change_list",help="Submitted Change list")
  File "C:\Python27\lib\optparse.py", line 1012, in add_option
    option = self.option_class(*args, **kwargs)
  File "C:\Python27\lib\optparse.py", line 566, in __init__
    self._set_opt_strings(opts)
  File "C:\Python27\lib\optparse.py", line 606, in _set_opt_strings
    self)
optparse.OptionError: invalid long option string '-submitted.cl': must start with --, followed by non-dash
4

1 に答える 1