Added --all flag to sys.args
This commit is contained in:
parent
6f0c36b67a
commit
691a3d6955
|
@ -706,6 +706,7 @@ def cli_main():
|
||||||
epilog = u"Parsing of arguments failed."
|
epilog = u"Parsing of arguments failed."
|
||||||
parser = argparse.ArgumentParser(prog=sys.argv[0], description=description, epilog=epilog)
|
parser = argparse.ArgumentParser(prog=sys.argv[0], description=description, epilog=epilog)
|
||||||
parser.add_argument('--devicedir', default='/media/KOBOeReader', help="directory of connected Kobo device")
|
parser.add_argument('--devicedir', default='/media/KOBOeReader', help="directory of connected Kobo device")
|
||||||
|
parser.add_argument('--all', action='store_true', help="flag for converting all books on device")
|
||||||
args = vars(parser.parse_args())
|
args = vars(parser.parse_args())
|
||||||
serials = []
|
serials = []
|
||||||
devicedir = u""
|
devicedir = u""
|
||||||
|
@ -714,6 +715,9 @@ def cli_main():
|
||||||
|
|
||||||
lib = KoboLibrary(serials, devicedir)
|
lib = KoboLibrary(serials, devicedir)
|
||||||
|
|
||||||
|
if args['all']:
|
||||||
|
books = lib.books
|
||||||
|
else:
|
||||||
for i, book in enumerate(lib.books):
|
for i, book in enumerate(lib.books):
|
||||||
print u"{0}: {1}".format(i + 1, book.title)
|
print u"{0}: {1}".format(i + 1, book.title)
|
||||||
print u"Or 'all'"
|
print u"Or 'all'"
|
||||||
|
|
Loading…
Reference in New Issue