#NEWLINE# def _CreateParser( ) : #NEWLINE# #INDENT# 'Creates our parameter parser, which accepts a restricted set of commands.\n\n  Returns:\n     A new ParameterParser.\n  ' #NEWLINE# idevice_app_runner = ParameterParser ( 'idevice-app-runner' , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) , ParameterDecl ( '-D' , type = str , nargs = '*' , action = DAction ) , ParameterDecl ( '-s' , '--start' , type = str ) , ParameterDecl ( '--args' , type = str , nargs = argparse . REMAINDER ) ) #NEWLINE# idevice_id = ParameterParser ( 'idevice_id' , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-l' , '--list' , action = 'store_true' ) ) #NEWLINE# idevice_date = ParameterParser ( 'idevicedate' , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) ) #NEWLINE# idevice_diagnostics = ParameterParser ( 'idevicediagnostics' , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) , ParameterDecl ( 'command' , type = str , choices = [ 'diagnostics' ] ) , ParameterDecl ( 'option' , type = str , choices = [ 'All' , 'WiFi' ] ) ) #NEWLINE# idevice_image_mounter = ParameterParser ( 'ideviceimagemounter' , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-l' , '--list' , action = 'store_true' ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) , ParameterDecl ( 'image' , type = InputFileParameter ) , ParameterDecl ( 'signature' , type = InputFileParameter ) ) #NEWLINE# idevice_info = ParameterParser ( 'ideviceinfo' , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-k' , '--key' , type = str ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) , ParameterDecl ( '-q' , '--domain' , type = str ) , ParameterDecl ( '-s' , '--simple' , action = 'store_true' ) , ParameterDecl ( '-x' , '--xml' , action = 'store_true' ) ) #NEWLINE# idevice_installer = ParameterParser ( 'ideviceinstaller' , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-i' , '--install' , type = InputFileParameter ) , ParameterDecl ( '-l' , '--list' , '--list-apps' , action = 'store_true' ) , ParameterDecl ( '-o' , '--options' , type = str ) , ParameterDecl ( '-U' , '--uninstall' , type = str ) ) #NEWLINE# idevicefs_ls = ParameterParser ( 'ls' , ParameterDecl ( '-F' , action = 'store_true' ) , ParameterDecl ( '-R' , action = 'store_true' ) , ParameterDecl ( '-l' , action = 'store_true' ) , ParameterDecl ( 'remote' , type = str , nargs = argparse . OPTIONAL ) ) #NEWLINE# idevicefs_pull = ParameterParser ( 'pull' , ParameterDecl ( 'remote' , type = str ) , ParameterDecl ( 'local' , type = OutputFileParameter ) ) #NEWLINE# idevicefs_push = ParameterParser ( 'push' , ParameterDecl ( 'local' , type = InputFileParameter ) , ParameterDecl ( 'remote' , type = str , nargs = argparse . OPTIONAL ) ) #NEWLINE# idevicefs_rm = ParameterParser ( 'rm' , ParameterDecl ( '-d' , action = 'store_true' ) , ParameterDecl ( '-f' , action = 'store_true' ) , ParameterDecl ( '-R' , action = 'store_true' ) , ParameterDecl ( 'remote' , type = str ) ) #NEWLINE# idevicefs_parsers = [ ParameterParser ( 'help' ) , idevicefs_ls , idevicefs_pull , idevicefs_push , idevicefs_rm ] #NEWLINE# idevice_fs = ParameterParser ( 'idevicefs' , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) ) #NEWLINE# idevice_fs . AddSubparsers ( * idevicefs_parsers ) #NEWLINE# idevice_screenshot = ParameterParser ( 'idevicescreenshot' , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) , ParameterDecl ( 'local' , type = OutputFileParameter ) ) #NEWLINE# idevice_syslog = ParameterParser ( 'idevicesyslog' , ParameterDecl ( '-d' , '--debug' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-u' , '--uuid' , type = IOSDeviceIdParameter ) ) #NEWLINE# idevice_parser = [ idevice_app_runner , idevice_date , idevice_diagnostics , idevice_fs , idevice_id , idevice_image_mounter , idevice_info , idevice_installer , adb_install , idevice_syslog ] #NEWLINE# adb_connect = ParameterParser ( 'connect' , ParameterDecl ( 'host' , type = str ) ) #NEWLINE# adb_devices = ParameterParser ( 'devices' , ParameterDecl ( '-l' , action = 'store_true' ) ) #NEWLINE# adb_install = ParameterParser ( 'install' , ParameterDecl ( '-r' , action = 'store_true' ) , ParameterDecl ( '-s' , action = 'store_true' ) , ParameterDecl ( 'file' , type = InputFileParameter ) ) #NEWLINE# adb_logcat = ParameterParser ( 'logcat' , ParameterDecl ( '-B' , action = 'store_true' ) , ParameterDecl ( '-b' , type = str ) , ParameterDecl ( '-c' , action = 'store_true' ) , ParameterDecl ( '-d' , action = 'store_true' ) , ParameterDecl ( '-f' , type = str ) , ParameterDecl ( '-g' , action = 'store_true' ) , ParameterDecl ( '-h' , '--help' , action = 'store_true' ) , ParameterDecl ( '-n' , type = int ) , ParameterDecl ( '-r' , type = int ) , ParameterDecl ( '-s' , action = 'store_true' ) , ParameterDecl ( '-t' , type = int ) , ParameterDecl ( '-v' , type = str ) , ParameterDecl ( 'filterspecs' , nargs = argparse . REMAINDER ) ) #NEWLINE# adb_pull = ParameterParser ( 'pull' , ParameterDecl ( 'remote' , type = str ) , ParameterDecl ( 'local' , type = OutputFileParameter ) ) #NEWLINE# adb_push = ParameterParser ( 'push' , ParameterDecl ( 'local' , type = InputFileParameter ) , ParameterDecl ( 'remote' , type = str ) ) #NEWLINE# adb_root = ParameterParser ( 'root' ) #NEWLINE# adb_shell = ParameterParser ( 'shell' , ParameterDecl ( 'arg0' , type = str ) , ParameterDecl ( 'args' , nargs = argparse . REMAINDER ) ) #NEWLINE# adb_uninstall = ParameterParser ( 'uninstall' , ParameterDecl ( '-k' , action = 'store_true' ) , ParameterDecl ( 'package' , type = str ) ) #NEWLINE# adb_waitfordevices = ParameterParser ( 'wait-for-device' ) #NEWLINE# adb_parsers = [ ParameterParser ( 'help' ) , adb_connect , adb_devices , adb_install , adb_logcat , adb_pull , adb_push , adb_root , adb_shell , adb_uninstall , adb_waitfordevices ] #NEWLINE# adb_parser = ParameterParser ( 'adb' , ParameterDecl ( '-s' , type = AndroidSerialParameter ) ) #NEWLINE# adb_parser . AddSubparsers ( * adb_parsers ) #NEWLINE# parser = ParameterParser ( None ) #NEWLINE# parser . AddSubparsers ( adb_parser , * idevice_parser ) #NEWLINE# return parser