Skip to content
Snippets Groups Projects
Verified Commit 951f899b authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Added flag to list ids

parent 815e1fe4
No related branches found
No related tags found
No related merge requests found
......@@ -260,6 +260,7 @@ def get_ls_command(group, endpoint, output_conf):
@click.option("--page-size", "-s", type=click.INT, default=None)
@click.option("--ordering", "-o", default=None)
@click.option("--filter", "-f", multiple=True)
@click.option("--ids", "-i", is_flag=True)
@click.option(
"--column",
"-c",
......@@ -271,9 +272,22 @@ def get_ls_command(group, endpoint, output_conf):
@click.pass_context
@async_command
async def ls(
ctx, raw, page, page_size, ordering, filter, query, column, format, no_headers
ctx,
raw,
page,
page_size,
ordering,
filter,
query,
column,
format,
no_headers,
ids,
):
if ids:
no_headers = True
column = [output_conf.get("id_field", "UUID")]
format = "plain"
async with ctx.obj["remote"]:
params = {"page": page}
if page_size:
......@@ -407,6 +421,7 @@ artists_ls = get_ls_command(
output_conf={
"labels": ["ID", "Name", "Albums", "Tracks", "Created"],
"type": "ARTIST",
"id_field": "ID",
},
)
......@@ -423,6 +438,7 @@ albums_ls = get_ls_command(
output_conf={
"labels": ["ID", "Title", "Artist", "Tracks", "Created"],
"type": "ALBUM",
"id_field": "ID",
},
)
......@@ -439,6 +455,7 @@ tracks_ls = get_ls_command(
output_conf={
"labels": ["ID", "Title", "Artist", "Album", "Disc", "Position"],
"type": "TRACK",
"id_field": "ID",
},
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment