Move clear_collections to own commands module
MODIFY
plex_trakt_sync/cli.py
plex_trakt_sync/cli.py
import click
-from plex_trakt_sync.clear_trakt_collections import clear_trakt_collections
+from plex_trakt_sync.commands.clear_collections import clear_collections
from plex_trakt_sync.commands.sync import sync
@@ -13,18 +13,5 @@ def cli(ctx):
sync()
-@click.command()
-@click.option('--confirm', is_flag=True, help='Confirm the dangerous action')
-def clear_collections(confirm):
- """
- Clear Movies and Shows collections in Trakt
- """
-
- if not confirm:
- click.echo('You need to pass --confirm option to proceed')
- return
- clear_trakt_collections()
-
-
cli.add_command(sync)
cli.add_command(clear_collections)

ADD
plex_trakt_sync/commands/clear_collections.py
+import click
+from plex_trakt_sync.clear_trakt_collections import clear_trakt_collections
+
+
+@click.command()
+@click.option('--confirm', is_flag=True, help='Confirm the dangerous action')
+def clear_collections(confirm):
+ """
+ Clear Movies and Shows collections in Trakt
+ """
+
+ if not confirm:
+ click.echo('You need to pass --confirm option to proceed')
+ return
+ clear_trakt_collections()

Move clear_collections to own commands module