def getopts():
    optp = OptionParser(usage=usage, version=__version__)
    # basic
    optp.add_option('-n', '--name', dest='name', help=_('Domain Name'))
    optp.add_option('-t', '--type', dest='type', help=_('VM Type'), default="xen")
    optp.add_option('-m', '--mem-size', dest='mem_size', help=_('Memory Size (MB)'), default=256)
    optp.add_option('-d', '--disk', dest='disk', help=_('Disk image file'), default=None)
    optp.add_option('-v', '--graphics-port', dest='graphics_port', help=_('Graphics Port Number'), default=None)
    optp.add_option('-u', '--uuid', dest='uuid', help=_('UUID'), default=None)
    optp.add_option('-a', '--mac', dest='mac', help=_('MAC Address'), default=None)
    optp.add_option('-c', '--vcpus', dest='vcpus', help=_('Number of virtual CPUs to allocate'), default=1)
    optp.add_option('-f', '--interface-format', dest='interface_format', help=_('Interface format'), default='b:xenbr0')
    optp.add_option('-b', '--keymap', dest='keymap', help=_('Graphics Keyboard Map'), default=DEFAULT_KEYMAP)
    optp.add_option('-e', '--extra', dest='extra', help=_('Extra kernel options'), default=None)
    # Storage pool only
    optp.add_option('-P', '--storage-pool', dest='storage_pool', help=_('Storage pool name'), default=None)
    optp.add_option('-V', '--storage-volume', dest='storage_volume', help=_('Storage volume name'), default=None)
    # make disk only
    optp.add_option('-D', '--disk-format', dest='disk_format', help=_('Disk format'), default=None)
    optp.add_option('-s', '--disk-size', dest='disk_size', help=_('Disk size (MB)'), default=1024*8)
    # IDE or SCSI or Virtio
    optp.add_option('-B', '--bus', dest='bus', help=_('Device bus type'), default=None)
    # ISO only
    optp.add_option('-o', '--iso', dest='iso', help=_('ISO image'), default=None)
    # Individual designation
    optp.add_option('-k', '--kernel', dest='kernel', help=_('Kernel image'), default=None)
    optp.add_option('-i', '--initrd', dest='initrd', help=_('initrd image'), default=None)

    return optp.parse_args()
dataset/ETHPy150Open karesansui/karesansui/bin/create_guest.py/getopts/original