dandi / dandi-cli

DANDI command line client to facilitate common operations
https://dandi.readthedocs.io/
Apache License 2.0
22 stars 27 forks source link

ls --help does not format supported URI schemes correctly #1501

Closed yarikoptic closed 1 month ago

yarikoptic commented 1 month ago

in

❯ dandi ls --help
Usage: dandi ls [OPTIONS] PATH|URL

  List .nwb files and dandisets metadata.

  The arguments may be either resource identifiers or paths to local
  files/directories.

  RESOURCE ID/URLS:

   dandi commands accept URLs and URL-like identifiers called <resource  ids>
   in the following formats for identifying Dandisets, assets, and  asset
   collections.

   Text in [brackets] is optional.  A server field is a base API or GUI URL
   for a DANDI Archive instance.  If an optional ``version`` field is  omitted
   from a URL, the given Dandiset's most recent published version  will be
   used if it has one, and its draft version will be used otherwise.      
   Accepted resource identifier patterns:  - DANDI:<dandiset id>[/<version>]
   - https://gui.dandiarchive.org/...  -
   https://identifiers.org/DANDI:<dandiset id>[/<version id>] (<version id>
   cannot be 'draft')  - https://<server>[/api]/[#/]dandiset/<dandiset
   id>[/<version>][/files[?location=<path>]]  - https://*dandiarchive-
   org.netlify.app/...  - https://<server>[/api]/dandisets/<dandiset
   id>[/versions[/<version>]]  - https://<server>[/api]/assets/<asset
   id>[/download]  - https://<server>[/api]/dandisets/<dandiset
   id>/versions/<version>/assets/<asset id>[/download]  -
   https://<server>[/api]/dandisets/<dandiset
   id>/versions/<version>/assets/?path=<path>  -
   https://<server>[/api]/dandisets/<dandiset
   id>/versions/<version>/assets/?glob=<glob>  - dandi://<instance
   name>/<dandiset id>[@<version>][/<path>]  - https://<server>/...

I have vague memory that @asmacdo might have fixed or RFed some code along similar lines in some past here or elsewhere. Please have a look if you could