From c3666ece2a509dbee155ee9e8141dc8e44994b2e Mon Sep 17 00:00:00 2001 From: Jan Caha Date: Thu, 12 Oct 2023 14:11:32 +0200 Subject: [PATCH 1/2] change namespace from option to argument --- mergin/cli.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mergin/cli.py b/mergin/cli.py index ff1d027a..fe2fe0f6 100755 --- a/mergin/cli.py +++ b/mergin/cli.py @@ -226,6 +226,7 @@ def create(ctx, project, public, from_dir): @cli.command() +@click.argument("namespace") @click.option( "--flag", help="What kind of projects (e.g. 'created' for just my projects," @@ -235,10 +236,6 @@ def create(ctx, project, public, from_dir): "--name", help="Filter projects with name like name", ) -@click.option( - "--namespace", - help="Filter projects with namespace like namespace", -) @click.option( "--order_params", help="optional attributes for sorting the list. " From 1a8fe37997e78c0af5483fcecabd1d7fa4f0e342 Mon Sep 17 00:00:00 2001 From: Jan Caha Date: Thu, 12 Oct 2023 16:07:02 +0200 Subject: [PATCH 2/2] drop flag option --- mergin/cli.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mergin/cli.py b/mergin/cli.py index fe2fe0f6..0bb3cedd 100755 --- a/mergin/cli.py +++ b/mergin/cli.py @@ -227,11 +227,6 @@ def create(ctx, project, public, from_dir): @cli.command() @click.argument("namespace") -@click.option( - "--flag", - help="What kind of projects (e.g. 'created' for just my projects," - "'shared' for projects shared with me. No flag means returns all public projects.", -) @click.option( "--name", help="Filter projects with name like name", @@ -245,17 +240,14 @@ def create(ctx, project, public, from_dir): "Available attrs: namespace, name, created, updated, disk_usage, creator", ) @click.pass_context -def list_projects(ctx, flag, name, namespace, order_params): +def list_projects(ctx, name, namespace, order_params): """List projects on the server.""" - filter_str = "(filter flag={})".format(flag) if flag is not None else "(all public)" - - click.echo("List of projects {}:".format(filter_str)) mc = ctx.obj["client"] if mc is None: return - projects_list = mc.projects_list(flag=flag, name=name, namespace=namespace, order_params=order_params) + projects_list = mc.projects_list(name=name, namespace=namespace, order_params=order_params) click.echo("Fetched {} projects .".format(len(projects_list))) for project in projects_list: