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

simplify the command-line api #403

Merged
merged 1 commit into from
May 7, 2014
Merged

simplify the command-line api #403

merged 1 commit into from
May 7, 2014

Conversation

nicks
Copy link
Contributor

@nicks nicks commented May 7, 2014

I remembered why I wanted this! It makes things a lot easier to read and to type. xargs + find isn't a good solution, because it's non-portable (find works slightly differently on different unixes)

There are 3 major changes here:

  • support for file globs
  • support for -O=ADVANCED
  • support for -W=VERBOSE

Based on feedback from the last PR, I added better docs on how to use this, and got rid of the gcc-style O=2

.put("QUIET", WarningLevel.QUIET)
.put("DEFAULT", WarningLevel.DEFAULT)
.put("VERBOSE", WarningLevel.VERBOSE)
.build();
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually if you have five keys or less you can just use .of() instead of the builder: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableMap.html#of(K, V)

so in this case:

    ImmutableMap.of(
        "QUIET", WarningLevel.QUIET,
        "DEFAULT", WarningLevel.DEFAULT,
        "VERBOSE", WarningLevel.VERBOSE);

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

@ChadKillingsworth
Copy link
Collaborator

With this new version, I have no objections.

@concavelenz
Copy link
Contributor

I'm fine with this.

MatrixFrog added a commit that referenced this pull request May 7, 2014
simplify the command-line api
@MatrixFrog MatrixFrog merged commit 9a47c89 into google:master May 7, 2014
@nicks nicks deleted the nick-cli2 branch May 8, 2014 00:45
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.

4 participants