-
Notifications
You must be signed in to change notification settings - Fork 39
text resizing based on the terminal column's width for sync logs #136
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
Conversation
This reverts commit 75ba9d9.
bin/helpers/sync/syncSpecsLogs.js
Outdated
@@ -13,7 +13,8 @@ let specSummary = { | |||
"specs": [], | |||
"duration": null | |||
} | |||
|
|||
let noWrap = utils.searchForOption('--no-wrap') |
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.
can we add validation around --no-wrap
?
@@ -221,6 +221,9 @@ var argv = yargs | |||
'local-config-file': { | |||
describe: Constants.cliMessages.RUN.LOCAL_CONFIG_FILE, | |||
type: "string" | |||
}, | |||
'no-wrap': { |
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.
add a default value, type, and alias
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.
Done
bin/helpers/sync/syncSpecsLogs.js
Outdated
@@ -81,7 +82,7 @@ let printSpecsStatus = (bsConfig, buildDetails) => { | |||
whileProcess(callback) | |||
}, | |||
function(err, result) { // when loop ends | |||
logger.info("\n--------------------------------------------------------------------------------") | |||
noWrap ? logger.info("\n--------------------------------------------------------------------------------") : logger.info("\n" + "-".repeat(terminalWidth)) |
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.
can we use noWrap?
to determine separator length in both cases? Something like
logger.info("-".repeat(noWrap ? X : terminalWidth))
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.
The X
is default and we would want the existing behaviour to continue in case of a no-wrap
. We can make it something like:
logger.info("-".repeat(noWrap ? 80 : terminalWidth))
Where 80 is the current number of the -
which are being printed.
- Added util for setting the no-wrap on process level as a BOOL val. - Moved the no-wrap logic to centralizeds place. - Added default value and the type accepted in the help text for yargs.
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.
LGTM
LGTM |
We will be widening or shorting the width of the column which shows the sync result logs for individual specs based on the current terminal's column width.
This PR adds the dynamically adjusting the specs listing column width based on the terminal/process' col size. Provides an option
--no-wrap
to disable the feature in case the user does not want the column to be resized.