Commit graph

289 commits

Author SHA1 Message Date
Felipe Sateler c54318c66f Add zsh completion for networkctl (#3062) 2016-04-18 23:27:42 +02:00
Evgeny Vereshchagin 6d94d993c7 bash completion: add --template to nspawn 2016-03-20 17:55:58 +00:00
Zbigniew Jędrzejewski-Szmek e81eb2874e systemd-resolve: initial shell completion
v2:
- use /sys/class/net to list interfaces,
  also copy the same code to systemd-nspawn
v3:
- do not propose "any" twice for --type
2016-02-18 11:50:53 -05:00
Daniel Mack 50f48ad37a cgroup: remove support for NetClass= directive
Support for net_cls.class_id through the NetClass= configuration directive
has been added in v227 in preparation for a per-unit packet filter mechanism.
However, it turns out the kernel people have decided to deprecate the net_cls
and net_prio controllers in v2. Tejun provides a comprehensive justification
for this in his commit, which has landed during the merge window for kernel
v4.5:

  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bd1060a1d671

As we're aiming for full support for the v2 cgroup hierarchy, we can no
longer support this feature. Userspace tool such as nftables are moving over
to setting rules that are specific to the full cgroup path of a task, which
obsoletes these controllers anyway.

This commit removes support for tweaking details in the net_cls controller,
but keeps the NetClass= directive around for legacy compatibility reasons.
2016-02-10 16:38:56 +01:00
Dan Walsh 2720e0c0f0 Journalctl command completion should show machines 2016-02-08 07:22:34 -05:00
Zbigniew Jędrzejewski-Szmek 8cd095cc27 shell-completion: fix header 2016-02-06 17:54:48 -05: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
Douglas Christman 655fd9d71f zsh-completion: Escape results for journalctl --unit
Escape colons and backslashes in unit names.
This gives correct completions for units with names like
    systemd-backlight@backlight:acpi_video0.service
and
    systemd-fsck@dev-disk-by\x2duuid-...
2016-01-25 18:10:31 -05:00
Lennart Poettering b43d75c378 importd: drop dkr support
The current code is not compatible with current dkr protocols anyway,
and dkr has a different focus ("microservices") than nspawn anyway
("whole machine containers"), hence drop support for it, we cannot
reasonably keep this up to date, and it creates the impression we'd
actually care for the microservices usecase.
2015-12-10 16:54:41 +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 18540892d1 bash-completion: list only valid signal names
Fixup for #1999.
2015-11-24 09:39:49 -05:00
Evgeny Vereshchagin d5d841ff9d bash-completion: nspawn: add completion for --kill-signal 2015-11-23 17:01:26 +00:00
Marcos Mello 1a51b1b1c2 shell-completion: journalctl: add --sync
From 94b6551
2015-11-15 14:04:15 -02:00
Filipe Brandenburger b4c14404b3 execute: Add new PassEnvironment= directive
This directive allows passing environment variables from the system
manager to spawned services. Variables in the system manager can be set
inside a container by passing `--set-env=...` options to systemd-spawn.

Tested with an on-disk test.service unit. Tested using multiple variable
names on a single line, with an empty setting to clear the current list
of variables, with non-existing variables.

Tested using `systemd-run -p PassEnvironment=VARNAME` to confirm it
works with transient units.

Confirmed that `systemctl show` will display the PassEnvironment
settings.

Checked that man pages are generated correctly.

No regressions in `make check`.
2015-11-11 07:55:23 -08:00
Marcos Mello 23c35c82c4 shell-completion: journalctl: add -S and -U options
Added by 66f5292
2015-11-11 08:29:46 -02: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
Lennart Poettering 51c41a97ec Merge pull request #1775 from fbuihuu/set-property-completion
bash-completion: add minimal support fpr 'set-property' command
2015-11-04 17:52:50 +01: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
Lennart Poettering 5732a7dbb0 Merge pull request #1690 from evverx/run-runtime-directory
systemd-run can launch units with RuntimeDirectory
2015-11-02 20:16:18 +01:00
Evgeny Vereshchagin 93557fcb5d shell-completion: systemctl: show completions for user in global mode 2015-10-30 04:55:32 +03:00
Evgeny Vereshchagin 1012972478 shell-completion: hostnamectl: add the command set-location 2015-10-29 07:47:16 +03:00
Evgeny Vereshchagin dcebcd7ade shell-completion: systemd-run: add the property RuntimeDirectory 2015-10-27 05:18:12 +03:00
Evgeny Vereshchagin 64fa5643df shell-completion: systemd-run: add the property ProtectHome 2015-10-26 00:22:34 +00:00
Zbigniew Jędrzejewski-Szmek 5ef80f3bbb zsh-completion: journalctl --identifier
Fixes #1549.
2015-10-25 10:49:19 -04:00
Evgeny Vereshchagin 4e79ac4425 shell-completion: systemd-run: add the property ProtectSystem 2015-10-24 22:49:46 +00:00
Nicolas Cornu 7e7cd2526d shell-completion: systemd-run: add new property EnvironmentFile 2015-10-21 16:18:59 +02:00
Nicolas Cornu 5ffd7671cc Add zsh completion on systemd-run's properties 2015-10-21 15:51:09 +02:00
Evgeny Vereshchagin 64a713d94d shell-completion: systemd-run: add new properties
"ReadWriteDirectories", "ReadOnlyDirectories", "InaccessibleDirectories"
2015-10-20 22:03:49 +00:00
Evgeny Vereshchagin e9cc999a30 shell-completion: systemd-run: add property OOMScoreAdjust 2015-10-17 20:03:40 +00:00
Evgeny Vereshchagin 8d2bc8e5fd shell-completion: systemd-run: add TimerSlackNSec property 2015-10-15 10:01:09 +00:00
Evgeny Vereshchagin 75d73dc9d0 shell-completion: systemd-run: add SyslogFacility property 2015-10-14 15:05:14 +00:00
Evgeny Vereshchagin 7135129e0a shell-completion: systemd-run: add SyslogLevel property 2015-10-14 14:48:55 +00:00
Lennart Poettering b3ccac01cc zsh: don't mention /etc/mtab
The file is obsolete, use /proc/self/mounts instead.

Also, yuck, the code is so awful...
2015-10-09 17:20:32 +02:00
Evgeny Vereshchagin dc800d8406 shell-completion: systemd-run: add new properties 2015-10-09 12:42:34 +00:00
Evgeny Vereshchagin f961371fb7 shell-completion: systemd-run: add new properties
See:
* 602b83559a
* b9c50073fc
2015-10-09 06:49:46 +03:00
Lennart Poettering 1af1f2f92e shell-completion: add pseudo machine ".host" to shell completion 2015-10-08 15:14:27 +02:00
Lennart Poettering 56f3cb335a shell-completion: add "machinectl shell" to bash completion logic 2015-10-08 15:03:31 +02:00
Lennart Poettering 23a749f285 Merge pull request #1419 from keszybz/shell-completion
Shell completion tweaks
2015-09-30 22:32:09 +02:00
Evgeny Vereshchagin 0c66ffd8b9 shell-completion: journalctl: add --rotate 2015-09-30 22:58:05 +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 db79008804 bash-completion: use builtins when generating list 2015-09-28 15:42:27 -04:00
Zbigniew Jędrzejewski-Szmek b00c1cf9d6 bash-completion: use builtins when generating list
awk is an external program, and it is better to stick to shell built-ins.

Also, even with external awk, sort -u is redundant, because the shell does
this on its own.
2015-09-28 15:23:04 -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 043a090d7d shell-completion: nspawn: add missing values for --link-journal 2015-09-26 04:10:08 +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
Evgeny Vereshchagin a2accacb98 shell-completion: cgtop bash completion: add -r,--raw,-k,-P,--order 2015-09-21 17:33:00 +00:00
Evgeny Vereshchagin 79af4b6c1c shell-completion: cgtop bash completion: -n,--iterations,-d,--delay require arg 2015-09-21 17:09:40 +00:00
Evgeny Vereshchagin 73b73b762c shell-completion: update systemd-cgtop bash completion: --recursive 2015-09-21 16:54:58 +00:00
Evgeny Vereshchagin 96a6426f30 cgtop: add -M/--machine 2015-09-21 12:04:45 +00:00
Evgeny Vereshchagin 20ba8107a5 shell-completion: update systemd-analyze bash-completion
* Change --no-man to --man (see dad29df)
* --{from,to}-pattern require arg
2015-09-07 04:51:21 +03: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 8c7db2fb21 run: enable interactive authorization 2015-09-01 16:43:08 +00:00
Evgeny Vereshchagin e50e53876f shell-completion: bash: add systemd-path completion 2015-08-31 19:24:16 +00:00
Evgeny Vereshchagin e4f246b1b5 shell-completion: bash: add networkctl completion 2015-08-28 18:01:48 +00:00
Evgeny Vereshchagin 17e98b9177 shell-completion: add failed state to --state compwords 2015-08-28 00:36:02 +00:00
Evgeny Vereshchagin 20bde81923 shell-completion: update systemd-run bash completion
Many new options have been added since the bash completion was last
updated.
2015-08-27 23:30:11 +00:00
Seth Jennings 4acd40613f shell-completion: bash: make list-transfers and cancel-transfer STANDALONE
list-transfers and cancel-transfers don't take machine arguments.
2015-08-18 13:22:42 -05:00
Seth Jennings 2977883de2 shell-completion: bash: add image transfer subcommands 2015-08-18 13:20:12 -05:00
Lennart Poettering 7b0991c617 Merge pull request #931 from spartacus06/update-completion-machinectl
Update shell completion for machinectl
2015-08-16 19:58:49 +02:00
Seth Jennings 4f8f4c310c shell-completion: use list-images rather than list
"machinectl list" only lists running machines while many of the MACHINES
commands use names of images; both running and non-running.

List machines from both "list" and "list-images" and use sort -u to
avoid duplicates.
2015-08-16 11:20:21 -05:00
Seth Jennings 6eb8bec62d shell-completion: update machinectl bash completion
Many new subcommands have been added since the bash completion was last
updated.  Bring it up to speed.
2015-08-16 11:19:36 -05:00
Lennart Poettering 9c75b2538a Merge pull request #947 from evverx/bash-completion
Update bash-completion: generate all unit types
2015-08-16 17:04:57 +02:00
Evgeny Vereshchagin adb0c25eb6 bash-completion: generate unit type list from systemctl -t help option 2015-08-16 14:53:21 +00:00
Nicolas Cornu cade10ccef zsh completion: update busctl 2015-08-15 13:58:05 +02:00
Eric Cook fb9d85b71a zsh-completion: _loginctl/_systemd/_systemd-inhibit improvements
_loginctl: respects the verbose style. which allows a user to get
the pre d5df0d950f behavior of not showing a description for sessions
and users, by default they aren't shown.

zstyle ':completion:*' verbose true
or
zstyle ':completion:*:loginctl*:*' verbose true # or similar
Will show the descriptions.

zstyle ':completion:*' verbose true
and
zstyle ':completion:*:loginctl*:*' verbose false # or similar
Won't show descriptions for loginctl only

_systemd: complete pids for systemd-notify's --pid option.
display a message of the expected argument for other options.

_systemd-inhibit: complete block & delay for --mode
display a message of the expected argument for --who/--why
2015-06-22 18:07:32 -04:00
Eric Cook 38cf1e292b zsh-completion: _systemd-nspawn - add more argument completion
filenames will be completed for --image/-i/--bind/--bind-ro/--tmpfs
network interfaces for --network-(interface|macvlan|ipvlan|bridge)
users for --user/-u, yes & no for --register, x86 * x86-64 for
--personality

display a message of the expected argument for --machine/-M/--uuid
--slice/-S/--port/-p/--selinux-*/-Z/-L/--setenv

Allow completing commands(and their options) of the host system for COMMAND
2015-06-21 21:59:26 -04:00
Eric Cook b0fe29ff9e zsh-completion: _loginctl - general bug fixes
1) the iterator `fun' has an local scope. after running the completer,
it will no longer be defined.

2) use _describe instead of calling compadd. Using compadd without
calling _description or something similar before, restricts the
user's ability to customize what is presented to them.
zstyle ':completion:*' format 'Completing %d'
  - now displays an header showing what is being completed.
zstyle ':completion::complete:loginctl-*::users' users user1 user2
  - allows the user to manually specify which users is offered
zstyle :completion::complete:loginctl-kill-user:\* \
ignored-patterns '(100<0-4>|user1)'
  - selectively ignore some users when completing loginctl kill-user
    <tab>
Sessions, UIDs now have descriptions when selecting them.

3) removed the call to _loginctl_all_seats in _loginctl_attach(), since
_loginctl_seats calls it a second time, right before adding matches.
There isn't a noticeable difference doing this.
2015-06-17 07:41:24 -04:00
Daniel Hahler a0ab162a09 zsh-completion: optimize _filter_units_by_property
Optimize _filter_units_by_property by calling `systemctl` only once with
a list of units, and not once per unit.

I could not reproduce the "Unknown unit" error mentioned in a FIXME,
which might have made this necessary previously.
2015-06-06 12:54:41 +02:00
Daniel Mack d4cb023490 Merge pull request #5 from systemd-mailing-devs/1432910411-14517-1-git-send-email-llua@gmx.com
zsh-completion: a more style/tag aware _systemctl
2015-06-02 17:57:43 +02:00
Daniel Mack ad2274289b Merge pull request #4 from systemd-mailing-devs/1431989131-25145-1-git-send-email-llua@gmx.com
zsh-completion: fix completion of --user services
2015-06-02 17:43:29 +02:00
Daniel Mack c521a430fd zsh-completion: fix typo in _bootctl
The command is 'install', not 'instal'. Fix that typo.
2015-06-01 12:07:19 +02:00
Ronny Chevalier da090dfd0b zsh-completion: update bootctl 2015-05-30 11:19:35 +02:00
Eric Cook d34b7c117b zsh-completion: a more style/tag aware _systemctl
using _wanted instead of calling compadd directly. this allows the user to customize
possible matches.

An example being, grouping units by type:
autoload -Uz compinit; compinit
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' format 'Completing %d'
zstyle -e ':completion:*:*:systemctl-(((re|)en|dis)able|(*re|)start|reload*):*' \
tag-order 'local type; for type in service template target socket;
    reply+=( systemd-units:-${type}:${type} ); reply=( "$reply systemd-units:-misc:misc" )'
zstyle ':completion:*:systemd-units-template' ignored-patterns '^*@'
zstyle ':completion:*:systemd-units-target' ignored-patterns '^*.target'
zstyle ':completion:*:systemd-units-socket' ignored-patterns '^*.socket'
zstyle ':completion:*:systemd-units-service' ignored-patterns '^*.service'
zstyle ':completion:*:systemd-units-misc' ignored-patterns '*(@|.(service|socket|target))'

also, <poke> http://lists.freedesktop.org/archives/systemd-devel/2015-May/032012.html
2015-05-29 17:04:09 +02:00
Eric Cook 68c4f6d406 zsh-completion: fix completion of --user services
By the time __systemctl is called, --user/--system are shifted out of
`words' by _arguments. This patch queries the array sooner.

In the case that both --user and --system are on the line when compsys runs,
_sys_service_mgr is set to the latter. Which is seemingly how systemctl behaves.

If neither are on the line, --system is set; for system services to be completed.
2015-05-19 01:01:40 +02:00
Eric Cook bf8864c2c0 zsh-completion: make the arrays _sys_active_units, _sys_startable_units and _sys_restartable_units local to the completer. 2015-05-18 05:22:09 -04:00
Eric Cook 2103d29d89 zsh-completion: removing more pointless forks
I seem to have forgot about _systemctl_active_units().
2015-05-18 05:22:09 -04:00
Eric Cook 463985a9f4 zsh-completion: less forking in _systemctl_failed_units() and make the array `_sys_failed_units' local to the completer. 2015-05-18 05:22:08 -04:00
Eric Cook e4e868f3ae zsh-completion: less forking in _systemctl_get_template_names() 2015-05-18 05:22:08 -04:00
Eric Cook fb869ca1d2 zsh-completion: actually complete template names for subcommands enable, reenable and disable.
compadd's -a option treats non-option arguments as arrays. So
$(_systemctl_get_template_names) expands to some words that aren't
legal array names. Even if there were, they would be empty; thus adding
nothing.

deduplicated a few functions too.
2015-05-18 05:22:08 -04:00
Eric Cook 67afa93148 zsh-completion: actually run _filter_units_by_property when creating the arrays _sys_(re|)startable_units 2015-05-18 05:22:08 -04: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
Lukas Rusak 6b85708cfd zsh-completion: add missing completions for systemd-nspawn 2015-05-16 11:54:28 -04:00
Lukas Rusak b93f15cd05 zsh-completion: update -M completion for systemd-analyze 2015-05-16 11:54:28 -04:00
Lukas Rusak b3b9282d0c zsh-completion: add missing completions for machinectl
Appologies, I'm still getting used to this mailing list thing and using git send-email
2015-05-16 11:54:28 -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
Ronny Chevalier d67b1f525f zsh-completion: update hostnamectl 2015-04-08 02:42:50 +02:00
Ronny Chevalier b178d279d9 zsh-completion: add missing -M completion for journalctl 2015-04-08 02:42:50 +02:00
Ronny Chevalier 8470025541 zsh-completion: update loginctl 2015-04-08 02:42:50 +02:00
Jan Janssen 5bdf22430e logind,systemctl: add reboot to EFI firmware support 2015-04-07 18:51:45 +02: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
Torstein Husebø cc98b3025e treewide: fix multiple typos 2015-01-26 10:39:47 -05:00
Wieland Hoffmann e37b56c735 zsh-completion: Do not interpret escape sequences in _filter_units_by_property
This makes all functions that rely on _filter_units_by_property() (like
_systemctl_{stop,kill,try_restart}) work with unit names that contain backslash
escaped sequences (like automount units with spaces that are escaped to
"\x20").
2015-01-21 10:59:40 +01:00
Moez Bouhlel d31f44e281 fix zsh completion typo
json-see => json-sse
2015-01-15 00:57:45 +01:00
Ronny Chevalier ee14023fd5 zsh-completion: add missing completions for systemd-tmpfiles 2015-01-12 22:19:34 +01:00
Ronny Chevalier a80cea6861 zsh-completion: add missing completions for systemd-run 2015-01-12 22:13:33 +01:00
Ronny Chevalier 26bd71f06c zsh-completion: add missing completions for systemd-analyze 2015-01-12 22:13:18 +01:00
Ronny Chevalier c285cb5c55 zsh-completion: add missing -M completion for timedatectl 2015-01-12 21:31:45 +01:00
Ronny Chevalier 720e0be0f0 zsh-completion: add missing completions for coredumpctl 2015-01-12 21:26:27 +01: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