Skip to content

Commit

Permalink
less command: added 'Examine a new file' operation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Jul 25, 2019
1 parent 93f63bc commit f7eaabc
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 62 deletions.
4 changes: 2 additions & 2 deletions builtins/src/main/java/org/jline/builtins/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static void less(Terminal terminal, InputStream in, PrintStream out, Prin
tabs.add(parseInteger(s));
}
}
Less less = new Less(terminal).tabs(tabs);
Less less = new Less(terminal, currentDir).tabs(tabs);
less.quitAtFirstEof = opt.isSet("QUIT-AT-EOF");
less.quitAtSecondEof = opt.isSet("quit-at-eof");
less.quiet = opt.isSet("quiet");
Expand All @@ -172,7 +172,7 @@ public static void less(Terminal terminal, InputStream in, PrintStream out, Prin
less.run(sources);
}

private static Source doUrlSource(Path currentDir, Path file) {
protected static Source doUrlSource(Path currentDir, Path file) {
Source out = null;
try {
out = new URLSource(currentDir.resolve(file).toUri().toURL(), file.toString());
Expand Down

1 comment on commit f7eaabc

@mattirn
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please sign in to comment.