Commit graph

30 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 99171d2fdf shell-completion: redirect all errors from systemctl to /dev/null
Completion scripts should not generate errors, ever.

https://bugzilla.redhat.com/show_bug.cgi?id=1409649
2017-01-11 16:37:34 -05:00
Yu Watanabe c07c80bc96 bash-completion: systemctl: use local variables 2016-09-14 15:22:45 +09:00
Yu Watanabe b1bdb6496c bash-completion: systemctl: do not pass masked or not-found units to filter
Also, add new function __filter_units_by_properties() for filtering units by
multiple properties, and make __get_startable_units() use it.

fixes #4114
2016-09-09 16:20:05 +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
Zbigniew Jędrzejewski-Szmek ed1190498f tree-wide: remove uses of --failed
It has been replaced by --state=failed.
2016-05-08 20:27:33 -04:00
Lennart Poettering aabf5d4243 systemctl: rename "reload-or-try-restart" verb to "try-reload-or-restart"
But also keep the old name as (undocumented) compatibility around.

The reload-or-try-restart was documented to be a NOP if the unit is not running, since the previous commits this is
also implemented. The old name suggests that the "try" logic only applies to restarting. Fix this, by moving the "try-"
to the front, to indicate that the whole option is a NOP if the service isn't running.
2016-01-28 18:57:04 +01:00
Evgeny Vereshchagin c2af810150 bash-completion: list valid signal names
this is a follow-up for commit 18540892d1
2015-11-24 16:05:42 +00:00
Zbigniew Jędrzejewski-Szmek 36b4a7ba55 Remove snapshot unit type
Snapshots were never useful or used for anything. Many systemd
developers that I spoke to at systemd.conf2015, didn't even know they
existed, so it is fairly safe to assume that this type can be deleted
without harm.

The fundamental problem with snapshots is that the state of the system
is dynamic, devices come and go, users log in and out, timers fire...
and restoring all units to some state from the past would "undo"
those changes, which isn't really possible.

Tested by creating a snapshot, running the new binary, and checking
that the transition did not cause errors, and the snapshot is gone,
and snapshots cannot be created anymore.

New systemctl says:
Unknown operation snapshot.
Old systemctl says:
Failed to create snapshot: Support for snapshots has been removed.

IgnoreOnSnaphost settings are warned about and ignored:
Support for option IgnoreOnSnapshot= has been removed and it is ignored

http://lists.freedesktop.org/archives/systemd-devel/2015-November/034872.html
2015-11-10 19:33:06 -05:00
Franck Bui d82fabdb7f bash-completion: add minimal support fpr 'set-property' command
'set-property' was missing from the list of known command.

Also a list of unit names will be proposed as next argument.

However no support on property names is provided since it would
require a hard coded list of them.
2015-11-04 08:42:16 +01:00
Evgeny Vereshchagin 93557fcb5d shell-completion: systemctl: show completions for user in global mode 2015-10-30 04:55:32 +03:00
Zbigniew Jędrzejewski-Szmek 4ed2f1b1f1 bash-completion: remove one more sort and sub-shell
{} is preferred to (), because the first is just grouping, while the
second invokes a separate shell.
2015-09-28 17:23:53 -04:00
Zbigniew Jędrzejewski-Szmek 840b2c0e77 shell-completion: use systemctl --state=help
This way completion lists should stay up to date.

Also use systemctl -t help to list types in zsh, as was already
done in bash.
2015-09-28 15:10:03 -04:00
Evgeny Vereshchagin 3a221b5df8 shell-completion: update systemctl bash completion
Many new options have been added since the bash completion was last
updated.
2015-09-04 23:04:10 +03:00
Evgeny Vereshchagin 17e98b9177 shell-completion: add failed state to --state compwords 2015-08-28 00:36:02 +00:00
Evgeny Vereshchagin adb0c25eb6 bash-completion: generate unit type list from systemctl -t help option 2015-08-16 14:53:21 +00:00
Zbigniew Jędrzejewski-Szmek 903e7c37ca Use "new" --job-mode= option in more places
--irreversible/--ignore-dependencies/--fail are deprececated since 4dc5b821ae.

Also add shell completions for --jobs-mode.
2015-05-18 01:08:09 -04:00
Zbigniew Jędrzejewski-Szmek 7b742b3130 shell-completion: systemctl switch-root verb
The completion is rudimentary (all files). I think this is OK since
this is used so rarely. But not having it proposed at all is annoying.
2015-04-08 11:28:45 -04:00
Jan Janssen 5bdf22430e logind,systemctl: add reboot to EFI firmware support 2015-04-07 18:51:45 +02:00
Ronny Chevalier 409886c424 shell-completion: systemctl edit 2014-12-10 01:10:01 +01:00
Zbigniew Jędrzejewski-Szmek 372b221166 bash-completion: use improved filtering to make things faster 2014-10-29 23:48:10 -04:00
Zbigniew Jędrzejewski-Szmek 9ff8af5460 bash-completion: rework startable/restartable units once more
I tried to use 'systemctl --all list-units' to filter unit files, but
this always filters out unit files which are not loaded. We want to complete
systemctl start with those units too, so this approach is not going to work.

New version is rather slow, but hopefully correct.
2014-10-29 23:48:09 -04:00
Zbigniew Jędrzejewski-Szmek 1cf3c30c07 shell-completion: systemctl set-default,get-default,is-system-running 2014-10-27 22:34:28 -04:00
Lukas Nykryn 8fc5cd71be shell-completion/bash: add add-wants and add-requires 2014-10-19 18:20:06 +02:00
Zbigniew Jędrzejewski-Szmek e9a19bd882 shell-completion: propose templates for disable/[re]enable/[re]start
Templates can be [re]enabled, on their own if the have DefaultInstance set,
and with an instance suffix in all cases. Propose just the template name
ending in @, to underline the instance suffix may have to be appended.

Likewise for start/restart.

This means that sometimes superflous units that one will not really
want to operate on will be proposed, but this seems better than
proposing a very incomplete set of names.

https://bugs.freedesktop.org/show_bug.cgi?id=66912
2014-10-14 21:20:05 -04:00
Zbigniew Jędrzejewski-Szmek f29c77bc01 shell-completion: fix completion of inactive units
Units which not loaded were not proposed properly. OTOH, we should
filter units from get-unit-files by their state if they are currently
loaded. Bring zsh completions in line with bash completion, the same
logic should be used in both implementations.

https://bugzilla.redhat.com/show_bug.cgi?id=1024379
https://bugzilla.redhat.com/show_bug.cgi?id=790768
https://bugs.freedesktop.org/show_bug.cgi?id=84720
2014-10-14 21:18:42 -04:00
Dave Reisner ec15977a3c completion: filter templates from restartable units
Since c6a373a263, we might encounter unit templates via the
'list-units' verb. These aren't restartable (and we throw errors), so
make sure they're filtered out of the completion options.

fixes downstream bug: https://bugs.archlinux.org/task/41719
2014-08-29 20:40:38 -04:00
Eric Cook c317a1a19c shell-completion: prevent mangling unit names (bash)
This fixes the issue noted by Zbigniew in most cases.
if a unit's name is enclosed in single quotes completion still
will not happen after the first `\'.

https://bugs.freedesktop.org/show_bug.cgi?id=78388
2014-07-27 15:27:16 -04:00
Zbigniew Jędrzejewski-Szmek c6a373a263 bash-completion: use list-unit-files to get "all" units
I think that it is better to return good results slightly more slowly,
than partial quickly. Also reading from disk seems fast enough. Even
the delay on first try with completely cold cache is acceptable.

This is just for bash, 'cause zsh was already doing this.

https://bugzilla.redhat.com/show_bug.cgi?id=790768
2014-07-26 20:15:38 -04:00
Zbigniew Jędrzejewski-Szmek 2c12a402cb shell-completion: systemd-analyze verify, systemctl link
Some zsh completion helpers were not installed, so completion
was broken.

Add systemd-analyze verify. Make systemctl link complete only
unit names.
2014-07-21 22:33:51 -04:00
Zbigniew Jędrzejewski-Szmek c0a67aef31 shell-completion: restore completion for -p
It was broken since systemd was moved out of /bin.

For zsh it was never there.
2014-07-15 10:06:12 -04:00
Renamed from shell-completion/bash/systemctl (Browse further)