Skip to content

Commit

Permalink
icm rm: remove multiple packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Jun 26, 2024
1 parent ad2d0f1 commit 44593ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion icm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def ls():


@cli.command()
@click.argument("collection", nargs=1)
@click.argument("collection", nargs=-1)
@click.option("-y", "--yes", is_flag=True, help="Respond yes automatically")
def rm(collection, yes):
"""Remove colections"""
Expand Down
10 changes: 5 additions & 5 deletions icm/commands/cmd_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from icm.commons import commons


def main(coltag: str, yes: bool) -> None:
def main(coltags: tuple, yes: bool) -> None:
"""ENTRY POINT: Remove collections
* coltag: Name+version of the collection to remove
(Ex. iceK-0.1.4)
Expand All @@ -20,15 +20,15 @@ def main(coltag: str, yes: bool) -> None:
print()

# -- Remove the collection!
rm_collection(collection, folders, coltag, yes)

for coltag in coltags:
rm_collection(collection, folders, coltag, yes)


def rm_collection(
collection: commons.Collection,
folders: commons.Folders,
coltag: str,
yes: bool = False
yes: bool = False,
) -> None:
"""Remove one collection
* collection: Context information,
Expand All @@ -38,7 +38,7 @@ def rm_collection(
* yes: Respond "yes" automatically
"""

# -- Build the Path to the collection
# -- Build the Path to the collection
abs_collection = folders.collections / coltag

# -- Check if the collection exists, as it was typed bye the user
Expand Down

0 comments on commit 44593ec

Please sign in to comment.