2021-01-29 16:05:22 +01:00
|
|
|
import click
|
2021-02-12 15:18:24 +01:00
|
|
|
from .checklinks import check_html_links
|
2021-01-29 16:05:22 +01:00
|
|
|
from .errors import RuleNotFoundError
|
|
|
|
|
|
|
|
@click.group()
|
|
|
|
@click.option('--debug/--no-debug', default=False)
|
|
|
|
def cli(debug):
|
|
|
|
'Tools automating RSPEC workflows.'
|
|
|
|
|
|
|
|
@cli.command()
|
|
|
|
@click.option('--rule', help='Validate only the rule matching the provided ID.')
|
|
|
|
def validate(rule):
|
2021-02-12 15:18:24 +01:00
|
|
|
'''Validate rules.'''
|
|
|
|
# TODO
|
|
|
|
if rule == '42':
|
|
|
|
raise RuleNotFoundError(rule)
|
2021-01-29 16:05:22 +01:00
|
|
|
|
2021-02-12 15:18:24 +01:00
|
|
|
@cli.command()
|
|
|
|
@click.option('--d', required=True)
|
|
|
|
def check_links(d):
|
|
|
|
'''Check links in html.'''
|
|
|
|
check_html_links(d)
|
|
|
|
|
2021-01-29 16:05:22 +01:00
|
|
|
|
|
|
|
__all__=['cli']
|