1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 08:29:02 -08:00
rc/sh/logs

15 lines
383 B
Bash
Executable file

#!/usr/bin/env bash
if [ -n "${ZSH_VERSION:-}" ]; then
logs() {
local last="${@: -1}"
[ -n "$last" ] && [ ${last[1]} != '-' ] && last="-u $last"
journalctl ${@:1:-1} $last
}
else
logs() {
local last="${@: -1}"
[ -n "$last" ] && [ ${last:0:1} != '-' ] && last="-u $last"
journalctl ${@:1:$(($#-1))} $last
}
fi
logs "$@"