Skip to content

Enhance handling of defaults #7

@bruceadams

Description

@bruceadams

Chatting with some people about wdscli as it stands helped get me thinking about how it might be made easier to use.

I'm fairly pleased with the current, stateless, implementation, but it does mean that credentials need to be supplied for every command. Also, for most commands, several service calls need to be made to establish context for whatever the command is going to do. That is: figuring out an environment_id, often a collection_id and sometimes a configuration_id. These service calls take time and can fail.

I can imagine wdscli having an option to write current defaults out to a file, then subsequent commands could use the defaults.

Suppose defaults are written to a file in the current directory. By using the current directory for defaults, a user can have different defaults for different contexts. Let's name that file wdscli-defaults.json wdscli could write out to that file: on request and probably whenever a resource is created. For example: creating a collection could set the defaults to: the current service credentials, the environment_id where the collection was created and the collection_id of that newly created collection. Then commands like show-environment, show-collection and add-document do not need any selection arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions