-
Notifications
You must be signed in to change notification settings - Fork 66
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
Support multiple prefixes to group them together and/or a regex #107
Labels
Comments
Each custom group will be split, which is designed. |
luw2007
added a commit
to luw2007/gci
that referenced
this issue
Jan 16, 2023
luw2007
added a commit
to luw2007/gci
that referenced
this issue
Jan 16, 2023
…ang0#107 Signed-off-by: Author Name <luw2007@gmail.com>
luw2007
added a commit
to luw2007/gci
that referenced
this issue
Jan 16, 2023
…ang0#107 Signed-off-by: luwei.will <luw2007@gmail.com>
daixiang0
added
enhancement
New feature or request
help wanted
Extra attention is needed
labels
Feb 21, 2023
ccoVeille
pushed a commit
to ccoveille-forks/daixiang0-gci
that referenced
this issue
Feb 25, 2023
…ang0#107 Signed-off-by: luwei.will <luw2007@gmail.com>
ccoVeille
added a commit
to ccoveille-forks/daixiang0-gci
that referenced
this issue
Feb 25, 2023
ccoVeille
added a commit
to ccoveille-forks/daixiang0-gci
that referenced
this issue
Feb 25, 2023
Signed-off-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
ccoVeille
added a commit
to ccoveille-forks/daixiang0-gci
that referenced
this issue
Feb 27, 2023
Signed-off-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
ccoVeille
added a commit
to ccoveille-forks/daixiang0-gci
that referenced
this issue
Feb 27, 2023
Signed-off-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
ccoVeille
added a commit
to ccoveille-forks/daixiang0-gci
that referenced
this issue
Feb 28, 2023
This changes allows to use this to group multiple prefixes gci write -s standard -s default -s 'Prefix(alt.code.company.com,code.company.com)' --custom-order --skip-generated In order to provide this, a change was needed in gci --section parameter parsing The code was using pflag.StringSliceP for parsing sections. Please consider the pflag documentation: > Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. > For example: --ss="v1,v2" --ss="v3" While the usage of StringSliceP was legitimate with -local legacy parameter, if we consider gci documentation: > -l, --local strings put imports beginning with this string after 3rd-party packages, separate imports by comma We can assume that when gci was rewritten in its "new style", it appears it was unintended to keep using pflag.StringSliceP. Switching back to StringArrayP allows us to use comma in CLI arguments, without this change the following command would have failed: gci write -s standard -s default -s 'Prefix(alt.code.company.com,code.company.com)' --custom-order --skip-generated because pflag.StringSliceP would have considered it as: gci write -s standard -s default -s 'Prefix(alt.code.company.com' -s 'code.company.com)' --custom-order --skip-generated We can assume this change will be OK. But it will break the following command: gci write -s standard,default It was working because of StringSliceP The syntax is now gci write -s standard -s default as documented Signed-off-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
ccoVeille
added a commit
to ccoveille-forks/daixiang0-gci
that referenced
this issue
Mar 1, 2023
This changes allows to use this to group multiple prefixes gci write -s standard -s default -s 'Prefix(alt.code.company.com,code.company.com)' --custom-order --skip-generated In order to provide this, a change was needed in gci --section parameter parsing The code was using pflag.StringSliceP for parsing sections. Please consider the pflag documentation: > Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. > For example: --ss="v1,v2" --ss="v3" While the usage of StringSliceP was legitimate with -local legacy parameter, if we consider gci documentation: > -l, --local strings put imports beginning with this string after 3rd-party packages, separate imports by comma We can assume that when gci was rewritten in its "new style", it appears it was unintended to keep using pflag.StringSliceP. Switching back to StringArrayP allows us to use comma in CLI arguments, without this change the following command would have failed: gci write -s standard -s default -s 'Prefix(alt.code.company.com,code.company.com)' --custom-order --skip-generated because pflag.StringSliceP would have considered it as: gci write -s standard -s default -s 'Prefix(alt.code.company.com' -s 'code.company.com)' --custom-order --skip-generated We can assume this change will be OK. But it will break the following command: gci write -s standard,default It was working because of StringSliceP The syntax is now gci write -s standard -s default as documented Signed-off-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
daixiang0
pushed a commit
that referenced
this issue
Mar 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have code hosted at
alt.code.company.com
andcode.company.com
It'd be nice to be able to provideprefix(alt.code.company.com,code.company.com)
or a regular expression to match it.So given:
The output of
Should yield:
The text was updated successfully, but these errors were encountered: