Skip to content

change namespace from option to argument #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions mergin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,11 @@ def create(ctx, project, public, from_dir):


@cli.command()
@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.argument("namespace")
@click.option(
"--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. "
Expand All @@ -248,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:
Expand Down