def setup_optparse(): parser = BPTOptionParser( usage='%prog command [ options ... ]', description='Tool for creating/managing package boxes', version='%%prog %s' % bpt.__version__) parser.disable_interspersed_args() parser.add_option('--help-commands', action='callback', callback=help_commands, help='informations about available commands') parser.add_option('-b', '--box', action='store', type='string', dest='box_path', help='box path. If not specified, use the current one.') return parser