mirror of
https://github.com/beetbox/beets.git
synced 2026-05-17 14:11:11 -04:00
Optparse doesn't support argparse nargs='+' style arguments. This patch adds a callback utility function that allows that idiom. The function is taken from the page at http://docs.python.org/2/library/optparse.html#callback-example-6-variable-arguments. Here's an example of how to use it: from beets.ui import vararg_callback parser.add_option("-c", "--callback", dest="vararg_attr", action="callback", callback=vararg_callback)