Skip to content

Conversation

@sywhang
Copy link
Contributor

@sywhang sywhang commented Nov 26, 2020

Related issue: #1754

The underlying cause in the issue is System.CommandLine simply calling .ToString() on the default argument. This can be fixed by defining a CounterList class and overriding the ToString() (very hacky, yes...), but will be addressed in a different PR, if at all.

I think the best way to address it instead is to deprecate this argument because we now have the --counters option which is the preferred way to specify the counters.

This also updates the description for the --counters argument.

@sywhang sywhang requested a review from a team as a code owner November 26, 2020 00:14
@sywhang sywhang requested a review from josalem November 30, 2020 18:11
@josalem
Copy link
Contributor

josalem commented Nov 30, 2020

CC @jonsequitur for S.CommandLine behavior

Just to make sure I've got this straight: --counters and --counter-list are the same semantic argument, just with a different delimiter (comma vs space)? The value of the argument is used for the same purpose?

@sywhang
Copy link
Contributor Author

sywhang commented Nov 30, 2020

Just to make sure I've got this straight: --counters and --counter-list are the same semantic argument, just with a different delimiter (comma vs space)?

That's correct.

Copy link
Contributor

@josalem josalem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to call this out in the change log. It's not technically a breaking change, but we should discuss deprecation of arguments.

@sywhang sywhang merged commit 239158a into dotnet:master Nov 30, 2020
@sywhang
Copy link
Contributor Author

sywhang commented Nov 30, 2020

We'll need to call this out in the change log. It's not technically a breaking change, but we should discuss deprecation of arguments.

The arg change was already introduced in 5.0 release that went public. Docs were all changed to use the new argument, so hopefully it should nudge them towards using the correct argument. The old argument is also still supported, just not recommended : )


private static Argument CounterList() =>
new Argument<List<string>>(name: "counter_list", getDefaultValue: () => new List<string>() )
new Argument<List<string>>(name: "counter_list", getDefaultValue: () => new List<string>())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getDefaultValue shouldn't be necessary here.

@sywhang sywhang mentioned this pull request Dec 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants