Skip to content

Command line syntax for explicitly passsing the empty collection as a param-value  #1987

Description

@nreid260

It's often useful to be able to explicitly specify a default value, rather than needing to special case to not pass the param at all (e.g. in a bash script). Empty collections are the natural default for most collection-values params, but there's no way to explicitly encode them as a value.

I propose that the empty string should be parsed as the empty collection, to fill this gap. Empty string is the best choice for this empty-collection sentinel because it's the result of string-joining an empty collection, so the transformation is vaguely symmetric.

This proposal does make it impossible to specify a collection containing only the empty string, which is inconsistent in some ways, but that input should be way less common than empty collection. This could be solved by generalizing that trailing separators are ignored by parsing, but that would be a larger change.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions