Commit Graph

39 Commits

Author SHA1 Message Date
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Yu Watanabe e2268fa437 bash-completion: do not ellipsize machine name 2020-01-10 12:29:02 +09:00
Frantisek Sumsal cec82cb943 bash-completion: correctly react to an unescaped unit name 2019-05-30 14:30:59 +02:00
Frantisek Sumsal f8f542482e bash-completion: don't sort syslog priorities
By default, the available completions are sorted alphabetically, which
is counterproductive in case of syslog priorities. Override the default
behavior using the `nosort` option
2019-04-26 08:04:15 +02:00
Frantisek Sumsal 72c9177db2 bash-completion: properly autocomplete escaped unit names 2019-04-24 18:03:15 +02:00
Zbigniew Jędrzejewski-Szmek 843cfcb15c shell-completion: use 4 space indentation too
The same as in other places, indentation levels were all over the place.
2019-04-12 08:34:44 +02:00
Frantisek Sumsal c01dbf6d19 bash-completion: unify indentation 2019-03-23 21:51:04 +01:00
Frantisek Sumsal 1413763ea5 bash-completion: use default completion for redirect operators 2019-03-23 21:50:50 +01:00
Jörg Sommer d9e15cbd18 journalctl: New option --cursor-file
The option cursor-file takes a filename as argument. If the file exists and
contains a valid cursor, this is used to start the output after this position.
At the end, the last cursor gets written to the file.

This allows for an easy implementation of a timer that regularly looks in the
journal for some messages.

    journalctl --cursor-file err-cursor -b -p err
    journalctl --cursor-file audit-cursor -t audit --grep DENIED

Or you might want to walk the journal in steps of 10 messages:

    journalctl --cursor-file ./curs -n10 --since=today -t systemd
2019-02-27 18:43:31 +01:00
Yu Watanabe fdc33681ae bash-completion: journalctl: use --output=help to show suggestions 2018-12-14 02:33:21 +09:00
Yu Watanabe d104486ab6 bash-completion: journalctl: drop deprecated --new-id128 option 2018-12-14 02:33:21 +09:00
Lennart Poettering 8e04444385 journalctl: port JSON output mode to new JSON API
Also, while we are at it, beef it up, by adding json-seq support (i.e.
https://tools.ietf.org/html/rfc7464). This is particularly useful in
conjunction with jq's --seq switch.
2018-10-11 17:25:27 +02:00
Yu Watanabe 652e39a378 bash-completion: journalctl: add --grep and --case-sensitive 2018-08-08 15:26:38 +09:00
Lennart Poettering 96b2fb93c5 tree-wide: beautify remaining copyright statements
Let's unify an beautify our remaining copyright statements, with a
unicode ©. This means our copyright statements are now always formatted
the same way. Yay.
2018-06-14 10:20:21 +02:00
Luca Boccassi 49805b3d81 journalctl: add with-unit mode
When dealing with a large number of template instances, for example
when launching daemons per VRF, it is hard for operators to correlate
log lines to arguments.
Add a new with-unit mode which, if available, prefixes unit and user
unit names when displaying its log messages instead of the syslog
identifier. It will also use the full timestamp with timezones, like
the short-full mode.
2018-05-25 14:45:34 +02:00
Yu Watanabe 41053e9bdf bash-completion: journalctl add missing options
Also, this deprecates '--this-boot' option.
2018-01-10 23:16:14 +09:00
Zbigniew Jędrzejewski-Szmek 7059062c2f Add SPDX license headers to shell completion scripts 2017-11-19 19:08:15 +01:00
Namhyung Kim 28b6b5de3f bash_completion: journalctl: Complete -t option values
The -t or --identifier requires a syslog identifier.
2017-01-21 16:38:23 +09:00
Namhyung Kim ed52c971bf bash_completion: journalctl: add missing options
The --no-hostname and --vacuum-files were missing, add them.
2017-01-21 16:38:04 +09:00
Lennart Poettering 29a753df76 journalctl: add new output mode "short-full" (#3880)
This new output mode formats all timestamps using the usual format_timestamp()
call we use pretty much everywhere else. Timestamps formatted this way are some
ways more useful than traditional syslog timestamps as they include weekday,
month and timezone information, while not being much longer. They are also not
locale-dependent. The primary advantage however is that they may be passed
directly to journalctl's --since= and --until= switches as soon as #3869 is
merged.

While we are at it, let's also add "short-unix" to shell completion.
2016-08-03 19:45:07 -04:00
Lennart Poettering 67044a24c3 bash: use the actual journal fields used in the journal files for completion 2016-05-30 19:35:24 +02:00
Dan Walsh 2720e0c0f0 Journalctl command completion should show machines 2016-02-08 07:22:34 -05:00
Marcos Mello 1a51b1b1c2 shell-completion: journalctl: add --sync
From 94b6551
2015-11-15 14:04:15 -02:00
Marcos Mello 23c35c82c4 shell-completion: journalctl: add -S and -U options
Added by 66f5292
2015-11-11 08:29:46 -02:00
Evgeny Vereshchagin 0c66ffd8b9 shell-completion: journalctl: add --rotate 2015-09-30 22:58:05 +03:00
Evgeny Vereshchagin 6409d3af08 shell-completion: journalctl: add missing options 2015-09-25 04:24:29 +03:00
Evgeny Vereshchagin 023dd03a42 shell-completion: journalctl: add missing fields 2015-09-25 03:52:07 +03:00
Carlos Morata Castillo b4f91f2ba3 Updates in bash autocompletions
Hi,

I did ./check-undocumented.sh -b (my script just submitted) and checked
the results.

Cheers.
2015-01-29 00:44:30 -05:00
Ronny Chevalier e4e5a85f34 shell-completion: add missing output modes
https://bugs.freedesktop.org/show_bug.cgi?id=88216
2015-01-09 13:53:23 +01:00
Zbigniew Jędrzejewski-Szmek be8f4a9fa7 bash-completion: -p option for journalctl 2014-07-19 19:47:10 -04:00
Lennart Poettering b68b76897a Revert "completion: don't offer completions for journalctl -b"
This reverts commit c756a6d57c.
2013-12-26 01:53:07 +01:00
Dave Reisner c756a6d57c completion: don't offer completions for journalctl -b
Since this is a shortopt with an optional argument, assume the user
knows what they're doing. The longopts --boot and --this-boot will
continue to offer boot IDs as completions.
2013-12-25 12:58:37 -05:00
Zbigniew Jędrzejewski-Szmek 7524c3cf44 bash-completion: journalctl --file 2013-11-15 22:54:51 -05:00
Zbigniew Jędrzejewski-Szmek f11880744c journalctl: add --list-boots to show boot IDs and times
Suggested by David Wilkins <dwilkins@maths.tcd.ie> in
https://bugzilla.redhat.com/show_bug.cgi?id=967521:

> [Specific boot ID is a] bit of a palaver to obtain.  I consulted the
> verbose dump of the journal to discover the _BOOT_ID for the
> timestamp, and then generated the journal dump for that boot using
> journalctl _BOOT_ID=foo -o short-monotonic.
2013-10-28 23:43:57 -04:00
Dave Reisner a72d698d0d bash-completion: use a better definition of __contains_word
- scope the iterator var
- use the correct, quoted, non-expansion prone positional parameter
  notation
- prevent expansion on RHS of comparison
- remove unneeded explicit returns.

This really should be defined only once...
2013-07-30 13:04:46 -04:00
Jan Janssen a331b5e6d4 journalctl: Add support for showing messages from a previous boot
Hi,

I redid the boot ID look up to use enumerate_unique.

This is quite fast if the cache is warm but painfully slow if
it isn't. It has a slight chance of returning the wrong order if
realtime clock jumps around.

This one has to do n searches for every boot ID there is plus
a sort, so it depends heavily on cache hotness. This is in contrast
to the other way of look-up through filtering by a MESSAGE_ID,
which only needs about 1 seek + whatever amount of relative IDs
you want to walk.

I also have a linked-list + (in-place) mergesort version of this
patch, which has pretty much the same runtime. But since this one
is using libc sorting and armortized allocation, I prefer this
one.

To summarize: The MESSAGE_ID way is a *lot* faster but can be
incomplete due to rotation, while the enumerate+sort will find
every boot ID out there but will be painfully slow for large
journals and cold caches.

You choose :P

Jan
2013-07-16 17:38:12 +02:00
Zbigniew Jędrzejewski-Szmek 3f3a438f58 journalctl: add --system/--user flags
--user basically gives messages from your own systemd --user services.
--system basically gives messages from PID 1, kernel, and --system
services. Those two options are not exahustive, because a priviledged
user might be able to see messages from other users, and they will not
be shown with either or both of those flags.
2013-06-10 10:10:06 -04:00
Harald Hoyer 1535fb7379 shell-completion/bash/journalctl: suppress stderr 2013-03-19 15:04:02 +01:00
Michael Biebl d611dadcc7 bash-completion: split completions and move to new location
Split the large bash completion script into separate, smaller files each
named after the binary it is used for and move the files to
/usr/share/bash-completion/completions. This way the completions can be
loaded on demand and we only install the completions for the tools we
actually build. The old path /etc/bash_completion.d/ is deprecated and
will disappear in the future.
2013-03-03 14:39:51 +01:00