description = 'Just a test'
parser = OptionParser(option_class=MultipleOption, usage=
    'usage: %prog [OPTIONS] COMMAND [BLOG_FILE]', version='%s %s' % (PROG,
    VERSION), description=description)
parser.add_option('-c', '--categories', action='extend', type='string',
    dest='categories', metavar='CATEGORIES', help=
    'comma separated list of post categories')
if len(sys.argv) == 1:
    parser.parse_args(['--help'])
OPTIONS, args = parser.parse_args()
print('arguments:', args)
print('options:', OPTIONS)
if __name__ == '__main__':
    main()
Processing multiple values for one single option using getopt/optparse?