def _get_service_version(self):
     args = sys.argv[1:]
     if "--version" in args:
         location = args.index("--version") + 1
         if location < len(args) and Utils.is_valid_version(args[location]):
             return args[0], args[location]
     return None, None
 def _handle_service_version_argumnet(self, args, parser):
     if "--version" in args:
         location = args.index("--version") + 1
         if location < len(args) and Utils.is_valid_version(args[location]):
             parser.add_argument('--version',
                                 dest='service_version',
                                 help='Display the version of this service,'
                                 'For example cvm-2017-03-12-RunInstances')
     else:
         parser.add_argument('--version',
                             dest='service_version',
                             help='Display the version of this service,'
                             'For example cvm-2017-03-12-RunInstances')