Skip to content

Commit

Permalink
Merge branch 'develop' into pre_commit_license_hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariana-B committed May 10, 2023
2 parents df7f48f + cae9c04 commit 801c482
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions datacube/scripts/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def index_cmd(index, product_names,
dataset_paths):

if not dataset_paths:
click.echo('Error: no datasets provided\n')
print_help_msg(index_cmd)
sys.exit(1)

Expand Down Expand Up @@ -249,6 +250,7 @@ def parse_update_rules(keys_that_can_change):
@ui.pass_index()
def update_cmd(index, keys_that_can_change, dry_run, location_policy, dataset_paths):
if not dataset_paths:
click.echo('Error: no datasets provided\n')
print_help_msg(update_cmd)
sys.exit(1)

Expand Down Expand Up @@ -416,6 +418,7 @@ def info_cmd(index: Index, show_sources: bool, show_derived: bool,
max_depth: int,
ids: Iterable[str]) -> None:
if not ids:
click.echo('Error: no datasets provided\n')
print_help_msg(info_cmd)
sys.exit(1)

Expand Down Expand Up @@ -486,6 +489,7 @@ def uri_search_cmd(index: Index, paths: List[str], search_mode):
PATHS may be either file paths or URIs
"""
if not paths:
click.echo('Error: no locations provided\n')
print_help_msg(uri_search_cmd)
sys.exit(1)

Expand All @@ -511,6 +515,7 @@ def uri_search_cmd(index: Index, paths: List[str], search_mode):
@ui.pass_index()
def archive_cmd(index: Index, archive_derived: bool, dry_run: bool, all_ds: bool, ids: List[str]):
if not ids and not all_ds:
click.echo('Error: no datasets provided\n')
print_help_msg(archive_cmd)
sys.exit(1)

Expand Down Expand Up @@ -559,6 +564,7 @@ def archive_cmd(index: Index, archive_derived: bool, dry_run: bool, all_ds: bool
def restore_cmd(index: Index, restore_derived: bool, derived_tolerance_seconds: int,
dry_run: bool, all_ds: bool, ids: List[str]):
if not ids and not all_ds:
click.echo('Error: no datasets provided\n')
print_help_msg(restore_cmd)
sys.exit(1)

Expand Down Expand Up @@ -606,6 +612,7 @@ def within_tolerance(dataset):
@ui.pass_index()
def purge_cmd(index: Index, dry_run: bool, all_ds: bool, ids: List[str]):
if not ids and not all_ds:
click.echo('Error: no datasets provided\n')
print_help_msg(purge_cmd)
sys.exit(1)

Expand Down
1 change: 1 addition & 0 deletions docs/about/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ v1.8.next
- Setup Dependabot, and Dependabot-generated updates (:pull:`1416`, :pull:`1420`, :pull:`1423`,
:pull:`1428`)
- Documentation fixes (:pull:`1417`, :pull:`1418`, :pull:`1430`)
- ``datacube dataset`` cli commands print error message if missing argument (:pull:`1437`)
- Add pre-commit hook to verify license headers (:pull:`1438`)


Expand Down

0 comments on commit 801c482

Please sign in to comment.