cli: jump to end of 'show log' commands automatically

Instead of having to scroll to the end (Shift G, or page down til end),
let's instead start at the end now that we have control over paging in
the CLI ourselves.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-11-28 15:10:48 +01:00
parent af0e24adf8
commit ad9c432ff9
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -189,9 +189,9 @@
<COMMAND name="all" help="Show all containers (default only running)">
<ACTION sym="script">doas container -a show</ACTION>
</COMMAND>
<COMMAND name="log" help="Show container log (alias for show log container)">
<COMMAND name="log" help="Show container log (jumps to end), alias to 'show log container'">
<ACTION sym="script" in="tty" out="tty" interrupt="true">
doas -u $USER cat /log/container |pager
doas -u $USER cat /log/container |pager +G
</ACTION>
</COMMAND>
<COMMAND name="images" help="Show container images">
+2 -2
View File
@@ -427,7 +427,7 @@
</SWITCH>
</COMMAND>
<COMMAND name="log" help="Show log file, default: syslog">
<COMMAND name="log" help="Show log file (jumps to end), default: syslog">
<PARAM name="fn" ptype="/LOGFILES" min="0" help="Optional log file to show"/>
<SWITCH name="optional" min="0">
<COMMAND name="tail" help="Show log tail, last N lines only">
@@ -447,7 +447,7 @@
if [ -n "$KLISH_PARAM_lines" ]; then
$cmd "$file" | tail -n $KLISH_PARAM_lines
else
$cmd "$file" | pager
$cmd "$file" | pager +G
fi
</ACTION>
</COMMAND>