You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by GitBox <gi...@apache.org> on 2021/02/09 04:49:39 UTC

[GitHub] [buildstream] gtristan edited a comment on pull request #1438: Tristan/remote cli options

gtristan edited a comment on pull request #1438:
URL: https://github.com/apache/buildstream/pull/1438#issuecomment-775659797


   > tl;dr I think it's preferrable to use singular option names in both cases - i.e. whether multiple remotes are allowed or just one.
   > [...]
   > In this pull request, seems like you're already doing so, like `--artifact-remote` and `--source-remote`.
   
   Agreed, and indeed the patch is implemented already as you suggest.
   
   e.g.:
   
   ```python
   @click.option(
       "--remote",
       "remotes",
       type=RemoteSpecType(RemoteSpecPurpose.PULL),
       multiple=True,
       help="A remote for downloading sources",
   )
   ```
   Here the CLI option is `--remote` while the variable name passed to the function is a list named `remotes`.
   
   When observing `--help` output, the value type `REMOTE` is derived from the newly added `RemoteSpecType` (click ParamType derivative), it will show something like:
   
   > --remote   REMOTE   Some command specific bla bla to feed to the blabbernaught
   
   Regarding documentation, I opted to add a single general section to the `Using -> Commands` section explaining how to fully specify remotes, and explaining that all `--remote` like options can be specified multiple times.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org