This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
class RestEndpointGroup(click.Group): | |
"""A click.Group sub-class that enables the use of command lines that | |
1. mirror REST endpoint structure | |
(eg. `mycli sources 123 slots 456` -> http://myapi/sources/:source_id/slots/:slot_id) | |
2. allow for implicit commands for `list` and `get` when no sub-commands are provided | |
on parent groups that support it. | |
(eg. `mycli sources` -> `mycli sources list`) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.