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.
This commit is contained in:
@@ -66,7 +66,7 @@ _journalctl() {
|
||||
compopt -o filenames
|
||||
;;
|
||||
--output|-o)
|
||||
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat with-unit'
|
||||
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse json-seq cat with-unit'
|
||||
;;
|
||||
--field|-F)
|
||||
comps=$(journalctl --fields | sort 2>/dev/null)
|
||||
|
||||
@@ -77,7 +77,7 @@ _machinectl() {
|
||||
comps=''
|
||||
;;
|
||||
--output|-o)
|
||||
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat'
|
||||
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse json-seq cat with-unit'
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
|
||||
@@ -169,7 +169,7 @@ _systemctl () {
|
||||
;;
|
||||
--output|-o)
|
||||
comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json
|
||||
json-pretty json-sse cat'
|
||||
json-pretty json-sse json-seq cat with-unit'
|
||||
;;
|
||||
--machine|-M)
|
||||
comps=$( __get_machines )
|
||||
|
||||
Reference in New Issue
Block a user