refactor: simplify sed/awk/grep uses, etc.#1574
Open
akinomyoga wants to merge 6 commits intoscop:mainfrom
Open
refactor: simplify sed/awk/grep uses, etc.#1574akinomyoga wants to merge 6 commits intoscop:mainfrom
akinomyoga wants to merge 6 commits intoscop:mainfrom
Conversation
The variable "prefix" is explicitly initialized when it is declared, so we do not need to explicitly set it to an empty string on this line.
The current implementation does not work for several reasons.
* First, for the selection "|" to work, one needs to enclose the
entire pattern with "@()". The option argument of the "-X" option is
not a regular expression, but an extended glob pattern.
* Next, the option argument of the "-X" option should not be singly
quoted in the present case because command substitutions in the
option argument of "-X" is not going to be expanded.
* Also, one also wants to quote the word of the here string. In Bash
< 4.4, the word of the here string is subject to word splitting, so
it may be affected by IFS.
In addition, we actually do not need to use the "tr" command. We can
reduce the spawn cost by using "${words[*]}" with an appropriate value
of IFS.
"_comp_cmd_tshark__{prefs,protocols}" are mutable global variables
used to cache the prefixes and protocols, so they should have "_mut_"
in the variable names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.