Skip to content

Commit 93fcec8

Browse files
more descriptive cli
1 parent 5df85eb commit 93fcec8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

stac_updater/cli.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
def stac_updater():
1616
pass
1717

18-
@stac_updater.command(name='new-service')
18+
@stac_updater.command(name='new-service', short_help="build a new service")
1919
def new_service():
2020
shutil.copyfile(sls_template_path, sls_config_path)
2121

22-
@stac_updater.command(name='update-collection')
23-
@click.option('--name', '-n', type=str, required=True)
24-
@click.option('--root', '-r', type=str, required=True)
25-
@click.option('--long-poll/--short-poll', default=False)
26-
@click.option('--concurrency', type=int, default=1)
22+
@stac_updater.command(name='update-collection', short_help="update a static collection")
23+
@click.option('--name', '-n', type=str, required=True, help="Name of collection, must match catalog name referenced by STAC Items.")
24+
@click.option('--root', '-r', type=str, required=True, help="URL of collection.")
25+
@click.option('--long-poll/--short-poll', default=False, help="Enable long polling.")
26+
@click.option('--concurrency', type=int, default=1, help="Sets lambda concurrency limit when polling the queue.")
2727
def update_collection(name, root, long_poll, concurrency):
2828
# Create a SQS queue for the collection
2929
# Subscribe SQS queue to SNS topic with filter policy on collection name
@@ -42,9 +42,9 @@ def update_collection(name, root, long_poll, concurrency):
4242
with open(sls_config_path, 'w') as outf:
4343
yaml.dump(sls_config, outf, indent=1)
4444

45-
@stac_updater.command(name='modify-kickoff')
46-
@click.option('--type', '-t', type=str, default='lambda')
47-
@click.option('--bucket_name', '-n', type=str)
45+
@stac_updater.command(name='modify-kickoff', short_help="modify event source of kickoff")
46+
@click.option('--type', '-t', type=str, default='lambda', help="Type of event source used by kickoff.")
47+
@click.option('--bucket_name', '-n', type=str, help="Required if type=='s3'; creates new bucket used by event source.")
4848
def modify_kickoff(type, bucket_name):
4949
func_name = 'kickoff'
5050

@@ -66,8 +66,8 @@ def modify_kickoff(type, bucket_name):
6666
with open(sls_config_path, 'w') as outf:
6767
yaml.dump(sls_config, outf, indent=1)
6868

69-
@stac_updater.command(name='add-notifications')
70-
@click.option('--topic_name', type=str, required=True)
69+
@stac_updater.command(name='add-notifications', short_help="notifications on catalog update")
70+
@click.option('--topic_name', type=str, required=True, help="Name of SNS topic.")
7171
def add_notifications(topic_name):
7272
# Remove all non-alphanumeric characters
7373
pattern = re.compile('[\W_]+')
@@ -86,7 +86,7 @@ def add_notifications(topic_name):
8686
with open(sls_config_path, 'w') as outf:
8787
yaml.dump(sls_config, outf, indent=1)
8888

89-
@stac_updater.command(name='deploy')
89+
@stac_updater.command(name='deploy', short_help="deploy service to aws")
9090
def deploy():
9191
subprocess.call("docker build . -t stac-updater:latest", shell=True)
9292
subprocess.call("docker run --rm -v $PWD:/home/stac_updater -it stac-updater:latest package-service.sh", shell=True)

0 commit comments

Comments
 (0)