Commit graph

26 commits

Author SHA1 Message Date
Eisuke Kawashima 20927c0eec
improve zsh completion (#32098)
* fix error
* remove options that are no longer supported
* add missing options
* stop completion if an option `--help` or `--version` is supplied

[[[
zjs: a note for the reader:

zshcompsys(1) in the section about optspecs in _arguments says:

> Each of the forms above may be preceded by a list in parentheses of option names  and  argument  num‐
> bers.  If the given option is on the command line, the options and arguments indicated in parentheses
> will not be offered.  For example, ‘(-two -three 1)-one:...' completes the option ‘-one'; if this ap‐
> pears  on  the  command line, the options -two and -three and the first ordinary argument will not be
> completed after it.  ‘(-foo):...' specifies an ordinary argument completion; -foo will  not  be  com‐
> pleted if that argument is already present.
> 
> Other  items  may  appear in the list of excluded options to indicate various other items that should
> not be applied when the current specification is matched: a single star (\*) for  the  rest  arguments
> (i.e. a specification of the form ‘\*:...'); a colon (:) for all normal (non-option-) arguments; and a
> hyphen (-) for all options.  For example, if ‘(\*)' appears before an option and the option appears on
> the  command  line,  the  list  of remaining arguments (those shown in the above table beginning with
> ‘\*:') will not be completed.

The intended effect of the change is to remove irrelevant completion matches from the completion.

tl;dr: (- : ) prevents further completion
]]]
2024-04-15 10:58:48 +02:00
samuelvw01 3623a7ea83 Update _udevadm 2024-03-16 21:51:56 +09:00
Yu Watanabe 1bf3dd4153 udev: downgrade log level about style issues
And add --no-style switch that make style issues not critical.
2023-06-05 11:37:26 +09:00
Dmitry V. Levin 9e36da1541 udevadm-verify: introduce --no-summary option
When udevadm verify is invoked by an analyzer tool like rpminspect
to verify individual udev rules files, the summary just clutters the
output, so provide an option to turn the summary off.
2023-05-21 23:20:30 +09:00
Dmitry V. Levin 0a7eda348c udevadm verify: introduce --root option
When udevadm verify is invoked without positional arguments and loads
all rules files from the system like the udev daemon does, this option
can be used to operate on files underneath the specified root path.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin acdba85e0e udevadm: introduce new 'verify' command
We seem to have no tool to verify udev rule files.  There is a simple
udev rules syntax checker in the tree, test/rule-syntax-check.py, but
it is too simple to detect less trivial issues not detected by udev,
e.g. redundant comparisons (#26593) or labels without references.

Such a tool would be beneficial not only for maintaining udev rules
distributed along with udev, but also and even more so for maintaining
third party udev rules that are more likely to have issues with syntax
and semantic correctness.

Implement a udev rules syntax and semantics checker in the form of
'udevadm verify [OPTIONS] FILE...' command that is based on
udev_rules_parse_file() interface and would apply further checks
on top of it in subsequent commits.

Resolves: #26606
2023-03-08 18:55:40 +00:00
Yu Watanabe d90dbba7ec shell-completion: update for udevadm 2022-04-05 04:36:20 +09:00
Yu Watanabe aa2b0d8d29 udevadm: introduce new 'wait' command
Prompted by https://github.com/systemd/systemd/pull/22717#issuecomment-1067348496.

The new command 'udevadm wait' waits for device or device symlink being
created. This may be useful to wait for a device is processed by udevd
after e.g. formatting or partitioning the device.
2022-04-01 15:13:18 +09:00
Danilo Krummrich 678f2b1667 udevadm: trigger: implement --initialized-match/nomatch arguments
systemd-udev-trigger.service by default triggeres all devices regardless
of whether they were already recognized by systemd-udevd.

There are machines (especially in embedded environments) where
systemd-udev-trigger.service is configured to run at a later stage of
the boot sequence, which can lead to quite a lot of devices being
triggered although they were already recognized by systemd-udevd.

Re-triggering a lot of devices is a relatively expensive operation and
therefore should be avoided if unnecessary.

Therefore this patch introduces --initialized-nomatch, which filters out
devices that are already present in the udev database. For consistance
reasons --initialized-match is implemented as well, which filters out devices
that are *not* already present in the udev database.

Replaces #19949.
2022-03-22 15:54:10 +09:00
Yu Watanabe 1baeee5784 udevadm trigger: introduce --type=all option 2022-03-22 15:27:06 +09:00
Yu Watanabe 873cf95c2f udevadm trigger: introduce --prioritized-subsystem option 2022-03-22 15:27:06 +09:00
Zbigniew Jędrzejewski-Szmek 07e8bdefdb shell-completion: fix indentation 2021-11-16 13:00:31 +01:00
Frantisek Sumsal 6c1482b28d udev: teach udevadm --property=NAME and --value options
which allows limiting the properties listed by the `--query=property` option
(and optionally listing only the respective values).
2021-09-29 13:32:25 +02:00
Yu Watanabe 7ce05a8d66 udevadm: introduce -a|--action option for test-builtin command
As net_setup_link builtin requires that a device action is set for the
sd_device object.
2021-08-18 00:08:08 +09:00
Yu Watanabe 74614801f6 shell-completion: add missing uevent actions for udevadm 2021-08-17 23:22:26 +09:00
Eric Cook 682e043c42 shell-completion: revert c1072f6473
fixing https://github.com/systemd/systemd/issues/19689
2021-06-17 14:42:46 +02:00
Yu Watanabe efe76b273a shell-completion: udevadm: support --uuid option
Follow-up for 730b9c1e14.
2021-06-04 15:00:11 +02:00
Yu Watanabe 6c99c26500 udevadm-trigger: introduce --quiet option
This may be useful to invoke the command by non-privileged users.
2021-02-21 04:40:23 +09:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Zbigniew Jędrzejewski-Szmek c1072f6473 shell-completion/zsh: add -*type*- headers
Since there's no file extension, emacs and other editors do not know that this is
supposed to be in shell syntax.
2019-04-12 08:36:18 +02:00
Zbigniew Jędrzejewski-Szmek 843cfcb15c shell-completion: use 4 space indentation too
The same as in other places, indentation levels were all over the place.
2019-04-12 08:34:44 +02:00
dana c501ecd70c zsh completion: Prevent functions from clobbering each other, &c.
- Don't redefine helpers on every call
- Prefix helper names with main function name
- Adjust some helper names for consistency and convention adherance
2019-01-08 15:23:37 +01:00
Zbigniew Jędrzejewski-Szmek 7059062c2f Add SPDX license headers to shell completion scripts 2017-11-19 19:08:15 +01: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
Tom Gundersen 0b99c9f8f0 udev: builtin - rename net_link to net_setup_link
Also add shell completions.
2013-10-29 14:17:57 +01:00
William Giokas a06225fcc1 zsh_completion: Split out zsh _udevadm 2013-08-02 10:43:49 -04:00