Skip to content

Commit

Permalink
small adjustments to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
m-haisham committed Aug 28, 2021
1 parent a706beb commit 62f7618
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions novelsave/cli/groups/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@

@cli.group(name='config')
def _config():
"""manage customizable configurations"""
"""Manage customizable configurations"""


@_config.group(name='novel_dir')
def _novel_dir():
"""manage configuration novel save location"""
"""Manage configuration novel save location"""


@_novel_dir.command(name='set')
@click.argument('path')
@inject
def _set_novel_dir(path, config_service: BaseConfigService = Provide[Application.services.config_service]):
"""set novel save location"""
"""Set novel save location"""
config_service.set_novel_dir(Path(path))
logger.info(f"Novel save directory has been updated ({path=})")


@_novel_dir.command(name='reset')
@inject
def _reset_novel_dir(config_service: BaseConfigService = Provide[Application.services.config_service]):
"""reset novel save location to default"""
"""Reset novel save location to default"""
config_service.reset_novel_dir()
logger.info(f"Novel save directory has been reset (path={config_service.get_novel_dir()})")
18 changes: 9 additions & 9 deletions novelsave/cli/groups/_novel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@cli.command(name='package')
@click.argument('id_or_url')
def _package(id_or_url: str):
"""package the specified novel to epub"""
"""Package the specified novel to epub"""
controllers.package(id_or_url)


Expand All @@ -17,7 +17,7 @@ def _package(id_or_url: str):
@click.option('--browser', help='Extract cookies from the specified browser and use them in subsequent requests.')
@click.option('--threads', type=int, help="Amount of threads to use when downloading chapters.")
def _process(id_or_url: str, limit: int, browser: str, threads: int):
"""runs 'update' and 'package' commands consecutively"""
"""Runs 'update' and 'package' commands consecutively"""
controllers.update(id_or_url, browser, limit, threads)
controllers.package(id_or_url)

Expand All @@ -40,18 +40,18 @@ def _metadata(id_or_url: str, metadata_url):
controllers.import_metadata(id_or_url, metadata_url)


@cli.group(name='novel')
def _novel():
"""Group of commands to manage novels"""


@_novel.command(name='info')
@cli.command(name='info')
@click.argument('id_or_url')
def _info(id_or_url: str):
"""Show saved information of the novel"""
"""Show saved information of a novel"""
controllers.show_info(id_or_url)


@cli.group(name='novel')
def _novel():
"""Manage more specific aspects of novels"""


@_novel.command(name='clean')
@click.argument('id_or_url')
@click.option('--content-only', is_flag=True, help="Only remove chapter content")
Expand Down

0 comments on commit 62f7618

Please sign in to comment.