# Path: wikked/commands/base.py
# class WikkedCommand(object):
#     def __init__(self):
#         self.name = None
#         self.description = None
#         self.requires_wiki = True
# 
#     def setupParser(self, parser):
#         raise NotImplementedError()
# 
#     def run(self, ctx):
#         raise NotImplementedError()
# 
#     def _doRun(self, ctx):
#         if ctx.wiki is None and self.requires_wiki:
#             raise Exception("No wiki found here.")
#         result = self.run(ctx)
#         if result is None:
#             result = 0
#         return result
# 
# def register_command(cls):
#     command_classes.append(cls)
#     return cls


import logging
                import re
from wikked.commands.base import WikkedCommand, register_command
            '-r', '--regex',
            action='store_true',
            help="Treat the specified pattern as a regular expression.")
        parser.add_argument(
            '--fs',
            help="Lists pages by scanning the file-system directly",
            action='store_true')

    def run(self, ctx):
        if ctx.args.fs:
            urls = [pi.url for pi in ctx.wiki.fs.getPageInfos()]
        else:
            urls = ctx.wiki.db.getPageUrls()

        if ctx.args.pattern:
            if ctx.args.regex:
                r = re.compile(ctx.args.pattern)
                for url in urls:
                    if r.search(url):
                        logger.info(url)
            else:
                for url in urls:
                    if ctx.args.pattern in url:
                        logger.info(url)
        else:
            for url in urls:
                logger.info(url)


@register_command

# Path: wikked/commands/base.py
# class WikkedCommand(object):
#     def __init__(self):
#         self.name = None
#         self.description = None
#         self.requires_wiki = True
# 
#     def setupParser(self, parser):
#         raise NotImplementedError()
# 
#     def run(self, ctx):
#         raise NotImplementedError()
# 
#     def _doRun(self, ctx):
#         if ctx.wiki is None and self.requires_wiki:
#             raise Exception("No wiki found here.")
#         result = self.run(ctx)
#         if result is None:
#             result = 0
#         return result
# 
# def register_command(cls):
#     command_classes.append(cls)
#     return cls


# Path: wikked/commands/query.py
import logging
                import re
from wikked.commands.base import WikkedCommand, register_command

            '-r', '--regex',
            action='store_true',
            help="Treat the specified pattern as a regular expression.")
        parser.add_argument(
            '--fs',
            help="Lists pages by scanning the file-system directly",
            action='store_true')

    def run(self, ctx):
        if ctx.args.fs:
            urls = [pi.url for pi in ctx.wiki.fs.getPageInfos()]
        else:
            urls = ctx.wiki.db.getPageUrls()

        if ctx.args.pattern:
            if ctx.args.regex:
                r = re.compile(ctx.args.pattern)
                for url in urls:
                    if r.search(url):
                        logger.info(url)
            else:
                for url in urls:
                    if ctx.args.pattern in url:
                        logger.info(url)
        else:
            for url in urls:
                logger.info(url)


@register_command

class GetCommand(WikkedCommand):