1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-14 17:39:03 -08:00
rc/sh/logs

16 lines
383 B
Text
Raw Normal View History

2013-06-28 05:22:14 -07:00
#!/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 "$@"