group options
This commit is contained in:
parent
9aa17397c0
commit
7587971229
10
wp2git.py
10
wp2git.py
|
@ -19,14 +19,16 @@ def sanitize(s):
|
||||||
def parse_args():
|
def parse_args():
|
||||||
p = argparse.ArgumentParser(description='Create a git repository with the history of the specified Wikipedia article.')
|
p = argparse.ArgumentParser(description='Create a git repository with the history of the specified Wikipedia article.')
|
||||||
p.add_argument('article_name')
|
p.add_argument('article_name')
|
||||||
g=p.add_mutually_exclusive_group()
|
g2 = p.add_argument_group('Output options')
|
||||||
|
g=g2.add_mutually_exclusive_group()
|
||||||
g.add_argument('-n', '--no-import', dest='doimport', default=True, action='store_false',
|
g.add_argument('-n', '--no-import', dest='doimport', default=True, action='store_false',
|
||||||
help="Don't invoke git fast-import; only generate fast-import data stream")
|
help="Don't invoke git fast-import; only generate fast-import data stream")
|
||||||
g.add_argument('-b', '--bare', action='store_true', help="Import to a bare repository (no working tree)")
|
g.add_argument('-b', '--bare', action='store_true', help="Import to a bare repository (no working tree)")
|
||||||
p.add_argument('-o', '--out', help='Output directory or fast-import stream file')
|
g2.add_argument('-o', '--out', help='Output directory or fast-import stream file')
|
||||||
g=p.add_mutually_exclusive_group()
|
g2 = p.add_argument_group('MediaWiki site selection')
|
||||||
|
g=g2.add_mutually_exclusive_group()
|
||||||
g.add_argument('--lang', default=lang, help='Wikipedia language code (default %(default)s)')
|
g.add_argument('--lang', default=lang, help='Wikipedia language code (default %(default)s)')
|
||||||
g.add_argument('--site', help='Alternate site (e.g. http://commons.wikimedia.org[/w/])')
|
g.add_argument('--site', help='Alternate MediaWiki site (e.g. http://commons.wikimedia.org[/w/])')
|
||||||
|
|
||||||
args = p.parse_args()
|
args = p.parse_args()
|
||||||
if not args.doimport:
|
if not args.doimport:
|
||||||
|
|
Loading…
Reference in New Issue