# HG changeset patch # User Ludovic Chabant # Date 1443151340 25200 # Node ID 4b3f867a98b0c689e887ee1e9ca7fec15d46e672 # Parent 9eb314a48fd98ee06e1a1a7345f5e5cec0fd7b41 get: Fix broken command. Remove `--resolve`, add `--raw`. diff -r 9eb314a48fd9 -r 4b3f867a98b0 wikked/commands/query.py --- a/wikked/commands/query.py Thu Sep 24 20:10:44 2015 -0700 +++ b/wikked/commands/query.py Thu Sep 24 20:22:20 2015 -0700 @@ -34,24 +34,28 @@ self.description = "Gets a page that matches the given URL." def setupParser(self, parser): - parser.add_argument('url', + parser.add_argument( + 'url', help="The URL of the page to get", nargs=1) - parser.add_argument('--resolve', - help="Re-resolve the page's content", + parser.add_argument( + '--raw', + help="Get the raw text of the page.", action='store_true') - parser.add_argument('--rev', + parser.add_argument( + '--rev', help="The revision to get", nargs=1) def run(self, ctx): - page = ctx.wiki.getPage(ctx.args.url) - if ctx.args.force_resolve: - page._force_resolve = True + page = ctx.wiki.getPage(ctx.args.url[0]) if ctx.args.rev is not None: logger.info(page.getRevision(ctx.args.rev)) return - logger.info(page.text) + if ctx.args.raw: + logger.info(page.raw_text) + else: + logger.info(page.text) @register_command