Conversation
870218a to
dbc18b9
Compare
|
I would like to have some guidance for users who are not familiar with the CLI yet, showing the flag Can we set a message like: What do you think, @brandonpayton? |
|
@fellyph @brandonpayton What do you think ? I’m not convinced about the printInfo(message: string, newLine = false): void {
if (this.isQuiet) return;
if (newLine) this.writeStream.write('\n');
this.writeStream.write(`${this.cyan('Info:')} ${message}\n`);
}Do you have any insights on it? |
|
I also prepared code to face these use cases : I'll create a new pull request with it once this one is merged. |
@mho22 I think this is a good idea that could just be done in this PR. If we do this, we won't even need to tell users about the |
I'm not convinced either. It seems to make sense that you'd only want to print an extra newline char when the info message itself will be printed, but it feels a bit entangled to have the function ask "Should I print an extra newline?" Maybe printing info in this PR will be going away anyway, if we always auto-select an available port when |
|
@brandonpayton I removed the |
@mho22 It looks like this PR will pick a random available port when the What we want is the following:
|
@mho22 Since we declare a default value of 9400 in the yargs declarations, won't yargs always assign to It would probably be good to add a couple of run-cli test for this, using |
|
@brandonpayton I had to remove the
On it. |
|
@brandonpayton I've added tests and they ran successfully. 👍. |
brandonpayton
left a comment
There was a problem hiding this comment.
Thanks, @mho22! This looks good.
Before merging, would you please update the --port args declared descriptions to mention the port defaults to 9400 when available? It seems like it would be good to still document this, even though we had to remove the yargs default.
f076643 to
aa0bc30
Compare
|
@mho22, this check also works for |
|
@fellyph I tried the following command and it worked as expected :
|



Motivation for the change, related issues
Based on this issue
The goal was to ignore stack traces, only print error messages in the CLI output style.
Implementation details
Added a
onErroroption inServerOptionsthat will be called once a error happens inapp.listen(..).Testing Instructions
CLI
or
Run the following command in two separate terminals :