chiark / gitweb /
journalctl: add --list-boots to show boot IDs and times
[elogind.git] / shell-completion / bash / journalctl
index 29bf6bca3fe95f6739788e7ea7aa2cbdd807693c..942a25357f82a3cfead9cae681e4bba9e8c068b8 100644 (file)
 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
 __contains_word () {
-        local word=$1; shift
-        for w in $*; do [[ $w = $word ]] && return 0; done
-        return 1
+        local w word=$1; shift
+        for w in "$@"; do
+                [[ $w = "$word" ]] && return
+        done
 }
 
 __journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
@@ -41,7 +42,7 @@ _journalctl() {
                               --disk-usage -f --follow --header
                               -h --help -l --local --new-id128 -m --merge --no-pager
                               --no-tail -q --quiet --setup-keys --this-boot --verify
-                              --version --list-catalog --update-catalog'
+                              --version --list-catalog --update-catalog --list-boots'
                        [ARG]='-b --boot --this-boot -D --directory -F --field
                               -o --output -u --unit --user-unit'
                 [ARGUNKNOWN]='-c --cursor --interval -n --lines -p --priority --since --until