Added the filter option for a list of tags.
This commit is contained in:
@@ -4,4 +4,6 @@
|
||||
Added the function that gets a list of repositories from a namespace.
|
||||
** 0.2.0 <2023-06-18 Sun>
|
||||
Added the function that gets a list of tags from a repository.
|
||||
** 0.3.0 <2023-06-18 Sun>
|
||||
Added the filter option for a list of tags.
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import typer
|
||||
|
||||
from docker_tags_getter.config.headers_config import HeadersConfig
|
||||
from docker_tags_getter.fetcher.api_fetcher import ApiFetcher
|
||||
from docker_tags_getter.filters.tags_filter import TagsFilter
|
||||
from docker_tags_getter.api.v2.repositories_api import RepositoriesAPI
|
||||
from docker_tags_getter.api.v2.tags_api import TagsAPI
|
||||
|
||||
@@ -42,6 +43,11 @@ def tags(
|
||||
help="[b]The repository[/] is a uniq identification of [b]a project[/].",
|
||||
show_default=False
|
||||
),
|
||||
filter: bool = typer.Option(
|
||||
None, "--filter", "-f",
|
||||
help="[b]The tags[/] will be filtered.",
|
||||
show_default=False
|
||||
),
|
||||
):
|
||||
"""
|
||||
[green b]All tags[/] will be returned for the [yellow b]namespace[/].
|
||||
@@ -61,6 +67,13 @@ def tags(
|
||||
|
||||
tags = tags_api.get_list()
|
||||
|
||||
if filter:
|
||||
if 'latest' in tags:
|
||||
tags.remove('latest')
|
||||
|
||||
tags_filter = TagsFilter()
|
||||
tags = tags_filter.filter_list(tags)
|
||||
|
||||
for tag in tags:
|
||||
console.print(tag)
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "docker-tags-getter"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
description = ""
|
||||
authors = ["Kostiantyn Klochko <kostya_klochko@ukr.net>"]
|
||||
readme = "README.rst"
|
||||
|
||||
Reference in New Issue
Block a user