Skip to content

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

Merged
merged 6 commits into from
Feb 16, 2017
Merged

New command api #3

merged 6 commits into from
Feb 16, 2017

Conversation

CGNonofr
Copy link
Contributor

No description provided.

for (Diagnostic<? extends JavaFileObject> diagnostic : diagnosticsCollector.getDiagnostics()) {
switch (diagnostic.getKind()) {

System.out.println("CG> redirect-streams -i \"err\" \"compilation\"");
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

yep ;-)

Copy link
Contributor Author

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\"");
Copy link
Contributor

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

Copy link
Contributor Author

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\"");
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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…

Copy link
Contributor Author

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";
Copy link
Contributor

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?

Copy link
Contributor Author

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, " "))
Copy link
Contributor

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", " ")

Copy link
Contributor Author

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?!

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@Sy1v4in Sy1v4in merged commit 458f95c into TechDotIO:master Feb 16, 2017
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.

2 participants