From 9687f1801b77caa8da31464f7703bf5417531387 Mon Sep 17 00:00:00 2001 From: Ben Sloane Date: Thu, 6 Jun 2019 14:28:58 -0400 Subject: [PATCH] tail: Default tail behavior with no arguments (#209) Make tail assume you wanted 10 lines of output if no -n option was provided. --- Userland/tail.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/tail.cpp b/Userland/tail.cpp index cf19e7b34e6..8fe43d992a8 100644 --- a/Userland/tail.cpp +++ b/Userland/tail.cpp @@ -7,6 +7,8 @@ #include #include +#define DEFAULT_LINE_COUNT 10 + int tail_from_pos(CFile& file, off_t startline, bool want_follow) { if (!file.seek(startline + 1)) @@ -95,6 +97,8 @@ int main(int argc, char *argv[]) args_parser.print_usage(); return 1; } + } else { + line_count = DEFAULT_LINE_COUNT; } CFile f(values[0]);