Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

Commit

Permalink
Fixed small bug with commandline parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDoee committed Mar 26, 2015
1 parent afd7ec3 commit 16a4b51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autotorrent/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def commandline_handler():
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", dest="config_file", default="autotorrent.conf", help="Path to config file")
parser.add_argument("--create_config", dest="create_config_file", default="autotorrent.conf", help="Creates a new configuration file")
parser.add_argument("--create_config", dest="create_config_file", nargs='?', const='autotorrent.conf', default=None, help="Creates a new configuration file")

parser.add_argument("-t", "--test_connection", action="store_true", dest="test_connection", default=False, help='Tests the connection to the torrent client')
parser.add_argument("-r", "--rebuild", dest="rebuild", default=False, help='Rebuild the database', nargs='*')
Expand All @@ -23,7 +23,7 @@ def commandline_handler():

logging.basicConfig(level=logging.DEBUG if args.verbose else logging.ERROR)

if args.create_config_file:
if args.create_config_file: # autotorrent.conf
if os.path.exists(args.create_config_file):
parser.error("Target %r already exists, not creating" % args.create_config_file)
else:
Expand Down

0 comments on commit 16a4b51

Please sign in to comment.