Commit Graph
109 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 136e59d275 zsh-completion: update start/restart completions
Now zsh should behave the same for those two subcommands as bash.

(cherry picked from commit 81333ecf9d)
2014-10-30 00:18:44 -04:00
Zbigniew Jędrzejewski-Szmek ad894f24df bash-completion: use improved filtering to make things faster
(cherry picked from commit 372b221166)
2014-10-30 00:18:35 -04:00
Zbigniew Jędrzejewski-Szmek b5d7c81b89 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.

(cherry picked from commit 9ff8af5460)
2014-10-30 00:03:38 -04:00
Zbigniew Jędrzejewski-Szmek 2a7401c74e shell-completion: systemctl set-default,get-default,is-system-running
(cherry picked from commit 1cf3c30c07)

Conflicts:
	TODO
	shell-completion/bash/systemctl.in

[stable: removed changes for is-system-running]
2014-10-30 00:01:56 -04:00
Zbigniew Jędrzejewski-Szmek 54a21e301c 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
(cherry picked from commit e9a19bd882)
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek 26df33449f 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
(cherry picked from commit f29c77bc01)
2014-10-26 18:23:47 -04:00
Dave Reisner 1016e13e6a 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

(cherry picked from commit ec15977a3c)
2014-10-26 18:23:46 -04:00
Eric Cook ab5543f5af 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
(cherry picked from commit c317a1a19c)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek 8c2e21cf4a 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
(cherry picked from commit c6a373a263)
2014-10-26 18:23:46 -04:00
Eric Cook 9d657ea294 shell-completion: prevent mangling unit names
Units with literal hex '\xFF' in their names has to be read
and printed properly.
dev-disk-byx2dlabel-root.device != dev-disk-by\x2dlabel-root.device

(cherry picked from commit 6d314eca15)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek b76c90d451 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.

(cherry picked from commit 2c12a402cb)

Conflicts:
	TODO

[backport: undo verify and busname changes]
2014-10-26 18:23:46 -04:00
William Giokas 7919b87d1f zsh-completion: Move output modes to autoload
(cherry picked from commit a02c5fe7cb)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek c2e540291d shell-completion: restore completion for -p
It was broken since systemd was moved out of /bin.

For zsh it was never there.

(cherry picked from commit c0a67aef31)

Conflicts:
	Makefile.am
2014-10-26 18:23:46 -04:00
Eric Cook b97a348e31 shell-completion(zsh): journalctl's -b changes
removed pointless index sort of bootids.
use `compadd -a' to add each array, instead of expanding possibly hundreds of words needlessly.
optional completion of -b

(cherry picked from commit c2026f28bd)
2014-10-26 18:23:45 -04:00
Zbigniew Jędrzejewski-Szmek 7eb1f731ea shell-completion,man: beef up chassis completions and description
Parameters to hostnamectl command are not optional and should not be marked
as such in the man page.

(cherry picked from commit 1ed7749564)
(cherry picked from commit ba838f7f9b)
2014-07-19 17:24:15 -04:00
Dan Kilman efa946235e bash completion: fix __get_startable_units
(cherry picked from commit a163b64c4b)
(cherry picked from commit cc9db03683)
2014-04-20 10:52:09 -04:00
Lennart Poettering 3c993d002a systemctl: --kill-mode is long long gone, don't mention it in the man page
(cherry picked from commit 0088d63151)
(cherry picked from commit 12a170a495)
2014-04-07 13:30:53 -04:00
Thomas Hindoe Paaboel Andersen 1c01cf8b9d add bash completion for systemd-cat
(cherry picked from commit 207017017d)
2014-03-05 00:52:39 -05:00
Thomas Hindoe Paaboel Andersen 838c834403 add bash completion for systemd-detect-virt
(cherry picked from commit 3bfe58cbd4)
2014-03-05 00:46:30 -05:00
Thomas Hindoe Paaboel Andersen 6772933b7f add bash completion for systemd-cgtop
(cherry picked from commit d9256bac4d)
2014-03-05 00:36:00 -05:00
Thomas Hindoe Paaboel Andersen 7d6ed8b92b add bash completion for systemd-cgls
(cherry picked from commit abdab4f602)
2014-03-05 00:27:48 -05:00
Thomas Andersen a18b0404be bash: add completion for systemd-nspawn
(cherry picked from commit 0d6883b6a8)
2014-03-05 00:26:50 -05:00
Thomas Hindoe Paaboel Andersen 3646a66d09 bootctl: add bash completion
(cherry picked from commit 95fe27d930)
2014-03-05 00:26:49 -05:00
Thomas Hindoe Paaboel Andersen 8d04b9ce22 delta: add bash completion
(cherry picked from commit 0bc8e31b35)
2014-03-05 00:26:49 -05:00
Thomas Hindoe Paaboel Andersen a3772fb0d4 machinectl: add bash completion
(cherry picked from commit e56056e93d)

Default to --no-legend if !on_tty().

Conflicts:
	man/machinectl.xml
	src/machine/machinectl.c
2014-03-05 00:26:49 -05:00
Tom Gundersen 91602b7c82 zsh-completions: kernel-install - only show existing kernels for 'remove'
When we remove a kernel, we don't remove the modules, so don't look at the modules directory to find installed kernels.

(cherry picked from commit d72143bad4)
2014-02-23 12:42:02 +00:00
Zbigniew Jędrzejewski-Szmek 14cf8f97d1 shell-completion: fix completion of localectl set-locale
https://bugs.freedesktop.org/show_bug.cgi?id=74157
(cherry picked from commit 627a98d398)
2014-02-23 12:42:02 +00:00
Zbigniew Jędrzejewski-Szmek 1bb3ed6816 bash-completion: fix completion of complete verbs
When doing 'command verb<TAB>', the arguments for verb would be
proposed, but it is too early. We should complete verb first.

https://bugs.freedesktop.org/show_bug.cgi?id=74596
(cherry picked from commit 3ce09b7da2)

Conflicts:
	shell-completion/bash/busctl
	shell-completion/bash/loginctl
	shell-completion/bash/systemctl
	shell-completion/bash/systemd-analyze
2014-02-23 12:42:02 +00:00
Lukas Nykryn e96f97ae44 shell-completion: remove load from systemctl
(cherry picked from commit f89a4474e0)

Conflicts:
	shell-completion/bash/systemctl
2014-02-23 12:42:01 +00:00
Jason St. John ae03512503 journalctl,zsh-completion: fix several issues in --help message text
-- fix grammar and reword some descriptions for clarity
-- add a useful description of what --follow does
-- fix the description for --after-cursor
-- properly introduce the FSS acronym for "Forward Secure Sealing" in
both sections
-- clarify the --disk-usage command

[zj: perform similar changes to zsh completions]

squash! journalctl: fix several issues in --help message text

(cherry picked from commit c736283bfb)

Conflicts:
	src/journal/journalctl.c
2014-02-23 12:41:56 +00:00
Zbigniew Jędrzejewski-Szmek 5db9aa5608 bash-completion: journalctl --file 2014-02-23 12:41:51 +00:00
Marko Myllynen f262a262c8 zsh-completion: add bootctl 2014-02-23 12:41:50 +00:00
Ronny Chevalier 72a0befe3e zsh-completion: add systemd-run 2014-02-23 12:01:39 +00:00
Zbigniew Jędrzejewski-Szmek 7c185c94af 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.
2014-02-23 12:01:38 +00:00
Zbigniew Jędrzejewski-Szmek cd8596ed35 shell-completion: dump has moved to systemd-analyze
Rename NO_OPTION to STANDALONE for consistency with other files.
2014-02-23 12:01:38 +00:00
Dave Reisner d808ca6414 completion/systemctl: add missing list-sockets verb 2013-09-20 14:48:43 -04:00
Zbigniew Jędrzejewski-Szmek 64eed40c07 bash-completion: add systemd-run 2013-09-12 19:36:27 -04:00
Zbigniew Jędrzejewski-Szmek fe05567c31 shell-completions: systemd-analyze set-log-level 2013-08-28 08:04:56 -04:00
William Giokas 9e15a18acd zsh_completion: Fix --user-unit completion
_SYSTEMD_USER_UNIT in the --user-unit flag argument should instead be
USER_UNIT. It should also have an optional `=` between the flag and the
argument.
2013-08-24 13:17:43 -04:00
William Giokas 862f4963c6 zsh_completion: Fix single letter args
Things like -n to specify the lines to show with systemctl and
journalctl accepts syntax like:

  journalctl -n4
  systemctl -n14

Previously, typing `-nXX <tab>` where XX is a number, zsh would try to
complete an integer. Now it will see the XX and use the _journalctl_none
completion. This is also how any of the single letter options that take
arguments work as well.
2013-08-23 12:48:14 -04:00
William Giokas 24a0282324 zsh_completion: Remove ctls function from _systemd
The _ctls function in the main _systemd file is not needed.
2013-08-15 11:29:09 -04:00
William Giokas 789b904a45 zsh_completion: machinectl properties can be stacked 2013-08-15 11:29:09 -04:00
William Giokas 298b9e23a6 zsh_completion: Allow specifying multiple arguments
Some of the options in systemd can take multiple arguments, such as
systemctl's --type option. Previously, you would only be able to
complete a single type after the -t, but now zsh will continue to
complete the types, separating them by commas.

systemd-inhibit's --what command has colon (:), and that has been taken
into account.
2013-08-15 11:29:08 -04:00
William Giokas 3e7f60ab32 zsh_completion: Move helper function to autoload
_hosts_or_user_at_host was used by 6 different completions, and
previously was in all 6 of those files. I moved it out to its own file,
_sd_hosts_or_user_at_host. This will be autoloaded for use in other
completion functions. It also allows external completions to use this
function by simply calling _sd_hosts_or_user_at_host as in the systemd
completions.
2013-08-14 22:42:56 -04:00
William Giokas ca08063781 zsh_completion: Correctly display journal fields
Show equals and field values when used with _journal_none, don't show
anything if we're not using _journal_none.
2013-08-14 22:23:08 -04:00
Zbigniew Jędrzejewski-Szmek 631c922c68 shell-completion: tell bash about --state 2013-08-12 12:04:49 -04:00
Daniel Wallace 7eb942c408 zsh completion: add _kernel-install 2013-08-03 09:20:12 -04:00
Zbigniew Jędrzejewski-Szmek a217fdc98e zsh_completion: add "gdb" verb to coredumpctl 2013-08-02 10:49:07 -04:00
William Giokas 4af6e458e5 zsh_completion: Speed up noncached perf of _journalctl
Splitting things unnecessarily at newlines causes tab completion to take
an extremely long time. Also add a note saying that caching is not good
for journalctl's completion.
2013-08-02 10:44:24 -04:00
William Giokas 1272ff850a zsh_completion: Split out zsh _systemd-tmpfiles
You can choose to have systemd-tmpfiles at configuration time, so only
install the completion for this if configured to do so.
2013-08-02 10:44:14 -04:00