8000 Add Culture parameter to Select-String cmdlet by iSazonov · Pull Request #10943 · PowerShell/PowerShell · GitHub 8000
[go: up one dir, main page]

Skip to content

Conversation

@iSazonov
Copy link
Collaborator
@iSazonov iSazonov commented Oct 30, 2019

PR Summary

Fix #8180
Add new Culture parameter to Select-String cmdlet.

PR Context

Implement PowerShell/PowerShell-RFC#167 for Select-String cmdlet.

PR Checklist

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 30, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.6 milestone Oct 30, 2019
@iSazonov iSazonov added the Documentation Needed in this repo Documentation is needed in this repo label Oct 30, 2019
@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Oct 30, 2019
Copy link
Member
@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

Please address Codacy issues

@iSazonov
Copy link
Collaborator Author
iSazonov commented Nov 1, 2019

Please address Codacy issues

I fix one but second impossible (interface implementation).

@iSazonov iSazonov force-pushed the add-culture-selectstring branch from 30524de to aa9cc09 Compare November 1, 2019 14:05
StringComparison compareOption = CaseSensitive ?
StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase;
while (patternIndex < Pattern.Length)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This old 'StringComparison compareOption = ...' code can be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 4, 2019
@adityapatwardhan
Copy link
Member

@iSazonov Can you respond to comment from @PaulHigin

@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 13, 2019
@iSazonov iSazonov removed the Documentation Needed in this repo Documentation is needed in this repo label Nov 13, 2019
@iSazonov
Copy link
Collaborator Author

@adityapatwardhan Paul's comment addressed. Doc issue was filled.

/// <summary>
/// Get list of valid culture names for ValidateSet attribute.
/// </summary>
public class ValidateMatchStringCultureNamesGenerator : IValidateSetValuesGenerator
Copy link
Member

Choose a reason for hiding this comment

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

Can this be internal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It must be public:

public ValidateSetAttribute(Type valuesGeneratorType)
{
// We check 'IsNotPublic' because we don't want allow 'Activator.CreateInstance' create an
// instance of non-public type.
if (!typeof(IValidateSetValuesGenerator).IsAssignableFrom(
valuesGeneratorType) || valuesGeneratorType.IsNotPublic)
{
throw PSTraceSource.NewArgumentException(nameof(valuesGeneratorType));
}

@adityapatwardhan
Copy link
Member

@iSazonov Please respond the comment from @TravisEz13

@adityapatwardhan adityapatwardhan merged commit ff37337 into PowerShell:master Nov 16, 2019
@iSazonov iSazonov deleted the add-culture-selectstring branch November 16, 2019 09:22
@ghost
Copy link
ghost commented Nov 21, 2019

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select-String -SimpleMatch does only current culture search

6 participants

0