number and depth are no longer required arguments

This commit is contained in:
Dominik Moritz Roth 2021-06-16 17:15:53 +02:00
parent 03cb19819b
commit 532357b186

View File

@ -604,7 +604,7 @@ def cliInterface():
cmds = parser.add_subparsers(required=True, dest='cmd') cmds = parser.add_subparsers(required=True, dest='cmd')
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec']) p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
p_rec.add_argument('num', type=int, default=25, help='number of books to recommend') p_rec.add_argument('-n', type=int, default=25, help='number of books to recommend')
p_read = cmds.add_parser('read', description="TODO", aliases=[]) p_read = cmds.add_parser('read', description="TODO", aliases=[])
p_read.add_argument('--min-rating', type=int, default=0) p_read.add_argument('--min-rating', type=int, default=0)
@ -614,7 +614,7 @@ def cliInterface():
p_show = cmds.add_parser('analyze', description="TODO", aliases=[]) p_show = cmds.add_parser('analyze', description="TODO", aliases=[])
p_show.add_argument('type', choices=['any', 'book', 'recommender', 'author', 'series']) p_show.add_argument('type', choices=['any', 'book', 'recommender', 'author', 'series'])
p_show.add_argument('name', type=str) p_show.add_argument('name', type=str)
p_show.add_argument('depth', type=float, default=2.7, help='depth of expansion') p_show.add_argument('-d', type=float, default=2.7, help='depth of expansion')
p_full = cmds.add_parser('full', description="TODO", aliases=[]) p_full = cmds.add_parser('full', description="TODO", aliases=[])
@ -630,11 +630,11 @@ def cliInterface():
removeUnread(G) removeUnread(G)
if args.cmd=="recommend": if args.cmd=="recommend":
recommendNBooks(G, mu, std, args.num) recommendNBooks(G, mu, std, args.n)
elif args.cmd=="read": elif args.cmd=="read":
readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected) readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected)
elif args.cmd=="analyze": elif args.cmd=="analyze":
analyze(G, args.type, args.name, args.depth) analyze(G, args.type, args.name, args.d)
elif args.cmd=="full": elif args.cmd=="full":
fullGraph(G) fullGraph(G)
else: else: