-
Notifications
You must be signed in to change notification settings - Fork 1
New command api #3
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
for (Diagnostic<? extends JavaFileObject> diagnostic : diagnosticsCollector.getDiagnostics()) { | ||
switch (diagnostic.getKind()) { | ||
|
||
System.out.println("CG> redirect-streams -i \"err\" \"compilation\""); |
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.
Are "
really mandatory for err
and compilation
parameters?
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.
No, do you want them removed?
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.
yep ;-)
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
for (Diagnostic<? extends JavaFileObject> diagnostic : diagnosticsCollector.getDiagnostics()) { | ||
switch (diagnostic.getKind()) { | ||
|
||
System.out.println("CG> redirect-streams -i \"err\" \"compilation\""); |
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.
As for annotate
, i would prefer long option --inputs=err
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
} | ||
System.out.println("CG> redirect-streams -r -i \"err\" \"compilation\""); |
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.
I would prefer --reset
instead of -r
. I though the reset option stands for "Cancel all the redirections". In this case, is the rest of the command mandatory?
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.
with this parameters, only the redirection between err
and compilation
is cancelled
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.
Ok. In this case, only err
has been redirected so…
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.
Not if the caller redirect an other stream before
case ERROR: | ||
type = "ERROR"; |
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.
In the doc, the type seems to be in lowercase… maybe it's case insensitive?
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.
Indeed it is!
diagnostic.getKind().name().toLowerCase(), | ||
diagnostic.getMessage(null), | ||
line, | ||
String.join("", Collections.nCopies((int)diagnostic.getColumnNumber() - 1, " ")) |
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.
Is it for padding? doesn't String.format
make the job?
Something like:
String.format("%"+diagnostic.getColumnNumber()+"s", " ")
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.
It's to reproduce the javac output format, I don't know this syntax?!
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.
%s
will print the string as it is. %<n>s
will print the string as it is, but if the string has less than n
characters, the output will be padded on the left.
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
No description provided.