Skip to content
Permalink
Browse files
174: git-webrev should support taking file list via STDIN
Reviewed-by: rwestberg
  • Loading branch information
edvbld committed Nov 28, 2019
1 parent f54b027 commit 0571c60ab4762b42619ecedad3a238609dc0f91e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
@@ -181,7 +181,7 @@ public Arguments parse(String[] args) {
}
seen.add(flag);
}
} else if (arg.startsWith("-")) {
} else if (arg.startsWith("-") && !arg.equals("-")) {
var name = arg.substring(1);
var flag = lookupShortcut(name);
if (flag.isSwitch()) {
@@ -256,8 +256,14 @@ private static void generate(String[] args) throws IOException {
List<Path> files = List.of();
if (arguments.at(0).isPresent()) {
var path = arguments.at(0).via(Path::of);
files = Files.readAllLines(path).stream().map(Path::of).collect(Collectors.toList());
if (path.equals(Path.of("-"))) {
var reader = new BufferedReader(new InputStreamReader(System.in));
files = reader.lines().map(Path::of).collect(Collectors.toList());
} else {
files = Files.readAllLines(path).stream().map(Path::of).collect(Collectors.toList());
}
}

Webrev.repository(repo)
.output(output)
.title(title)

0 comments on commit 0571c60

Please sign in to comment.