-directory = DirectoryGotoToplevel()
-options = [make_option('-n', '--name',
- help = 'use NAME as the patch name'),
- make_option('-B', '--ref-branch',
- help = 'pick patches from BRANCH'),
- make_option('-r', '--reverse',
- help = 'reverse the commit object before importing',
- action = 'store_true'),
- make_option('-p', '--parent', metavar = 'COMMITID',
- help = 'use COMMITID as parent'),
- make_option('-x', '--expose',
- help = 'append the imported commit id to the patch log',
- action = 'store_true'),
- make_option('--fold',
- help = 'fold the commit object into the current patch',
- action = 'store_true'),
- make_option('--update',
- help = 'like fold but only update the current patch files',
- action = 'store_true'),
- make_option('--unapplied',
- help = 'keep the patch unapplied',
- action = 'store_true')]
+args = [argparse.patch_range(argparse.applied_patches,
+ argparse.unapplied_patches,
+ argparse.hidden_patches)]
+options = [
+ opt('-n', '--name',
+ short = 'Use NAME as the patch name'),
+ opt('-B', '--ref-branch', args = [argparse.stg_branches],
+ short = 'Pick patches from BRANCH'),
+ opt('-r', '--reverse', action = 'store_true',
+ short = 'Reverse the commit object before importing'),
+ opt('-p', '--parent', metavar = 'COMMITID', args = [argparse.commit],
+ short = 'Use COMMITID as parent'),
+ opt('-x', '--expose', action = 'store_true',
+ short = 'Append the imported commit id to the patch log'),
+ opt('--fold', action = 'store_true',
+ short = 'Fold the commit object into the current patch'),
+ opt('--update', action = 'store_true',
+ short = 'Like fold but only update the current patch files'),
+ opt('-f', '--file', action = 'append',
+ short = 'Only fold the given file (can be used multiple times)'),
+ opt('--unapplied', action = 'store_true',
+ short = 'Keep the patch unapplied')]
+
+directory = DirectoryGotoToplevel(log = True)