systemctl: make `--timestamp=` affect the `show` verb as well
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 18 Feb 2022 22:09:18 +0000 (23:09 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 19 Feb 2022 09:16:30 +0000 (10:16 +0100)
commita59e5c625da5a6e0c46e493d55f2f4212e9457ca
tree8770334b83a1aea29246d292bd374dc3510a0f48
parentb7de9651db7bdbb42befa653791980daa50448bb
systemctl: make `--timestamp=` affect the `show` verb as well

Currently the `--timestamp=` option has no effect on timestamps shown by
`systemctl show`, let's fix that.

Spotted in #22567.

Before:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 15:25:57 CET
StateChangeTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ConditionTimestamp=Sat 2021-12-11 15:25:57 CET
AssertTimestamp=Sat 2021-12-11 15:25:57 CET
```

After:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 14:25:57.177848 UTC
StateChangeTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
InactiveExitTimestamp=Sat 2021-12-11 14:25:57.177871 UTC
ActiveEnterTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
ActiveExitTimestamp=Sat 2021-12-11 14:25:57.144677 UTC
InactiveEnterTimestamp=Sat 2021-12-11 14:25:57.176331 UTC
ConditionTimestamp=Sat 2021-12-11 14:25:57.176980 UTC
AssertTimestamp=Sat 2021-12-11 14:25:57.176980 UTC

```
src/systemctl/systemctl-show.c