Skip to content

Make options, arguments, and commands *read-only* collections on CommandLineApplication#407

Merged
natemcmaster merged 1 commit intorelease/4.0from
feature/readonly-app
Nov 13, 2020
Merged

Make options, arguments, and commands *read-only* collections on CommandLineApplication#407
natemcmaster merged 1 commit intorelease/4.0from
feature/readonly-app

Conversation

@natemcmaster
Copy link
Owner

@natemcmaster natemcmaster commented Nov 7, 2020

This gives CommandLineApplication more control over how the definition of the
application is constructed. Validation can be enforced, and refactoring of the internal
storage mechanism can happen without breaking the contract with callers.

Impact

Before

var app = new CommandLineApplication();
app.Options.Add(new CommandOption("-v", CommandOptionType.NoValue));
app.Arguments.Add(new CommandArgument());
app.Commands.Add(new CommandLineApplication());

After

New API has been added to replace these actions

var app = new CommandLineApplication();
app.AddOption(new CommandOption("-v", CommandOptionType.NoValue));
app.AddArgument(new CommandArgument());
app.AddSubcommand(new CommandLineApplication());

…on CommandLineApplication

This gives CommandLineApplication more control over how the definition of the
application is constructed. Validation can be enforced, and refactoring of the internal
storage mechanism can happen without breaking the contract with callers.
@natemcmaster natemcmaster added this to the 4.0.0 milestone Nov 7, 2020
@natemcmaster natemcmaster merged commit 4ceb8db into release/4.0 Nov 13, 2020
@natemcmaster natemcmaster deleted the feature/readonly-app branch November 13, 2020 17:14
natemcmaster added a commit that referenced this pull request Jan 10, 2021
…dLineApplication (#407)

This gives CommandLineApplication more control over how the definition of the
application is constructed. Validation can be enforced, and refactoring of the internal
storage mechanism can happen without breaking the contract with callers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant