Skip to content
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

Simple solution to issue #3413 Removing inserted blank lines from pagnated output #3414

Conversation

clifcox
Copy link
Contributor

@clifcox clifcox commented Feb 18, 2025

We make the lazy assumption that when you can't turn off pagination with something like "terminal length 0", that Dell always puts an undesirable blank line before the --More-- prompt. :-)

This will make diffs fail between TFTPd and oxidized copies of the same config.

Pre-Request Checklist

  • Passes rubocop code analysis (try rubocop --auto-correct)
  • Tests added or adapted (try rake test)
  • Changes are reflected in the documentation
  • User-visible changes appended to CHANGELOG.md

Description

Perhaps Closes #3413 ?

…_paginated_output

We make the lazy assumtion that when you can't turn off pagenation with something like "terminal length
0", that Dell always puts an undesirable blank line before the --More-- prompt. :-)

This will make diffs fail between TFTPd and oxidized copies of the same config.
powerconnect: Remove undesirable inserted blank lines during pagination. Fixes ytti#3413
@@ -5,7 +5,7 @@ class PowerConnect < Oxidized::Model

comment '! '

expect /^\s*--More--\s+.*$/ do |data, re|
expect /\n\s*--More--\s+.*/ do |data, re| # Also grab the blank line above the --More--
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why remove the End of Line ($) at the end of the match?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Howdy,

good question. :-) Though I'm not an expert but it seems redundant, because without a /m modifier, the '.' does not match '\n' and '.*' is greedy so it will grab all up to the next '\n' anyway, so it's the same? We could put it back in if you like. :-)

Clif

@robertcheramy robertcheramy merged commit bda276e into ytti:master Feb 24, 2025
7 checks passed
@clifcox clifcox deleted the 3413-Removing_inserted_blank_lines_from_paginated_output branch February 28, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing inserted blank lines from paginated output
2 participants