Skip to content
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

Edit api creation docs to reflect correct CLI usage #813

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

jwlodek
Copy link
Member

@jwlodek jwlodek commented Nov 19, 2024

Checklist

  • Add a Changelog entry
  • Add the ticket number which this PR closes to the comment section (N/A)

Currently, if the docs are followed, we get a typer error:

(2024-2.3-py311-tiled) [jwlodek@xf31id1-ws3 ~]$ tiled api_key create --scopes read:metadata read:data --profile nsls2
Usage: tiled api_key create [OPTIONS]
Try 'tiled api_key create --help' for help.
╭─ Error ───────────────────────────────────────────────────────────────────────────────────────────╮
│ Got unexpected extra argument (read:data)                                                         │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯

This is because list arguments with typer work by using the same flag multiple times. I.e:

tiled api_key create --scopes read:metadata --scopes read:data --profile nsls2

If you run the above, it works as expected. My guess is that it is possible that this may need to be fixed in the docs in other places as well for other List CLI args.

@danielballan
Copy link
Member

Thanks @jwlodek. Fortunately this seems to be the only instance of this mistake in the code:

$ git grep -e "--scopes"
docs/source/how-to/api-keys.md:$ tiled api_key create --expires-in 600 --scopes read:metadata
docs/source/how-to/api-keys.md:$ tiled api_key create --note="Data validation pipeline" --scopes read:metadata read:data

@danielballan
Copy link
Member

...Not to say that there aren't other list parameters...but this was a typo not a conceptual confusion on my part, so I'm hopeful. I'll keep an eye out.

@danielballan danielballan merged commit 0143d81 into bluesky:main Nov 19, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants