-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow for filtering of output. #171
Conversation
- Command output may be filtered by `|` followed by whitespace and a regular expression (or a simple string). - The regular expression is applied to each line of output, and only lines that match are displayed. - The expression may be negated by using `|!` instead of `|`. - Substitution is not supported.
6ed8d77
to
20023ac
Compare
- re.Pattern requires python 3.7+ as a bare minumum.
|
||
if filter_str.startswith("!"): | ||
negate = True | ||
filter_str = filter_str[1:].strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This strip is superflous as it has already been stripped. Just need the [1:]
.
You are mixing functial and formatting changes. Makes review very hard. |
Yeah. Sadly my editor setup is strict with PEPs. I'll try to review the settings for the project for every copy of the repo I work on. In general though I'm tempted to do a pure formatting PR towards black and isort, and adding them to a lint job. |
- Command output may be filtered by `|` followed by whitespace and a regular expression (or a simple string). - The regular expression is applied to each line of output, and only lines that match are displayed. - The expression may be negated by using `|!` instead of `|`. - Substitution is not supported. Examples: - `network list_used_addresses 172.16.20.0 | bl23-.*mu2[17]` will output only lines matching the regular expression. - `network list_used_addresses 172.16.20.0 |! mu2[17]` will output only lines *not* matching the regular expression. This applies all commands that output to the console, but it does *not* apply to errors, warnings, or informational messages. This allows filters to be used without concern for missing important information. This is a cleaner Singleton-based implementation of unioslo#171.
Superseded by a much better implementation in #174. |
- Command output may be filtered by `|` followed by whitespace and a regular expression (or a simple string). - The regular expression is applied to each line of output, and only lines that match are displayed. - The expression may be negated by using `|!` instead of `|`. - Substitution is not supported. Examples: - `network list_used_addresses 172.16.20.0 | bl23-.*mu2[17]` will output only lines matching the regular expression. - `network list_used_addresses 172.16.20.0 |! mu2[17]` will output only lines *not* matching the regular expression. This applies all commands that output to the console, but it does *not* apply to errors, warnings, or informational messages. This allows filters to be used without concern for missing important information. This is a cleaner Singleton-based implementation of unioslo#171.
* feat: Allow for filtering of output - Command output may be filtered by `|` followed by whitespace and a regular expression (or a simple string). - The regular expression is applied to each line of output, and only lines that match are displayed. - The expression may be negated by using `|!` instead of `|`. - Substitution is not supported. Examples: - `network list_used_addresses 172.16.20.0 | bl23-.*mu2[17]` will output only lines matching the regular expression. - `network list_used_addresses 172.16.20.0 |! mu2[17]` will output only lines *not* matching the regular expression. This applies all commands that output to the console, but it does *not* apply to errors, warnings, or informational messages. This allows filters to be used without concern for missing important information. This is a cleaner Singleton-based implementation of #171.
|
followed by whitespace and a regular expression (or a simple string).|!
instead of|
.Examples:
network list_used_addresses 172.16.20.0 | bl23-.*mu2[17]
will output only lines matching the regular expression.network list_used_addresses 172.16.20.0 |! mu2[17]
will output only lines not matching the regular expression.This applies all commands that output to the console, but it does not apply to errors, warnings, or informational messages. This allows filters to be used without concern for missing important information.