From 18c8e48595ea009d201ebb25adce45a7603e467d Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 5 Nov 2019 10:57:59 -0500 Subject: [PATCH] Added note on executable --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 72d881944..edd605f24 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,14 @@ The formatter can act on whole files, on limited lines (`--lines`), on specific offsets (`--offset`), passing through to standard-out (default) or altered in-place (`--replace`). +It is convenient to have a shell script named `google-java-format` with the +java command: + +``` +#!/bin/sh +java -jar /path/to/google-java-format-1.7-all-deps.jar "$@" +``` + To reformat changed lines in a specific patch, use [`google-java-format-diff.py`](https://github.com/google/google-java-format/blob/master/scripts/google-java-format-diff.py).