Skip to content

Commit 35c1f4f

Browse files
feat: add ability to load definitions in cp
1 parent f164cd0 commit 35c1f4f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

taskqueue_cli/taskqueue_cli.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import math
3+
import importlib
34

45
import click
56
from tqdm import tqdm
@@ -72,7 +73,8 @@ def release(queuepath):
7273
@main.command()
7374
@click.argument("src")
7475
@click.argument("dest")
75-
def cp(src, dest):
76+
@click.option('--load', default=None, help="Load a module to get task definitions.", show_default=True)
77+
def cp(src, dest, load):
7678
"""
7779
Copy the contents of a queue to another
7880
service or location. Do not run this
@@ -82,6 +84,9 @@ def cp(src, dest):
8284
but you can copy an fq to sqs. The mv
8385
command supports sqs queues.
8486
"""
87+
if load:
88+
importlib.import_module(load)
89+
8590
src = normalize_path(src)
8691
dest = normalize_path(dest)
8792

0 commit comments

Comments
 (0)