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

Better commands in series console output #137

Open
tleunen opened this issue May 9, 2017 · 3 comments
Open

Better commands in series console output #137

tleunen opened this issue May 9, 2017 · 3 comments

Comments

@tleunen
Copy link
Collaborator

tleunen commented May 9, 2017

I'm not sure if it's possible with the current state of nps and nps-utils, or if this is something you all would be interested in.

When I use multiple commands in series, I usually have 3 or more commands, which makes the output really not clear with the command on multiple lines.

So, instead of having this following thing:

nps executing: rimraf dist/prod && node scripts/something.js -o src/generated-file.js && webpack --config ./webpack --env.custom_value something-awesome

Because everything is in series, would it make sense to split the output in X "nps executing" lines?

nps executing: rimraf dist/prod
nps executing: node scripts/something.js -o src/generated-file.js
nps executing: webpack --config ./webpack --env.custom_value something-awesome

Or in one line, with a bit of formatting?

nps executing: rimraf dist/prod && 
    node scripts/something.js -o src/generated-file.js && 
    webpack --config ./webpack --env.custom_value something-awesome

Ideally, this should work for && in general, not only with npsUtils

@kentcdodds
Copy link
Collaborator

If we can come up with a good way to do that I'd be happy to do that. Unfortunately I don't see it being very reasonable to do reliably without parsing the command which I don't really want to do.

Now we could improve npsUtils to add a newline with series or you could write your own series function to do that.

Anyway, definitely happy to entertain a PR for that if it's reasonable.

@tleunen
Copy link
Collaborator Author

tleunen commented May 18, 2017

Probably better to write my own function to add the newline. Quite simple fn.

In addition to that, maybe we could have some prettyPrint functions to keep the log under 80 characters or any number of characters available in the terminal).

I wonder if something exists already for that.

@kentcdodds
Copy link
Collaborator

Not sure I follow what you mean, but I know that yargs does change it's --help output based on the width of your terminal... Maybe they use something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants