Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 13, 2020

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.

None yet

1 participant