Commit Graph

361 Commits

Author SHA1 Message Date
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
Carlos Morata Castillo 8c5463585d bash-completion: systemd-nspawn update
*Autocompletion for dirs, doesn't leave until you press space.
*Added tmpfs, volatile and network-macvlan options.

I tried with the SELinux options with seinfo(setools-console), but too
messy to get it right. Even Daniel Walsh haven't done it yet. :)
2015-01-08 16:33:59 -05:00
Lennart Poettering e275f5e204 shell-completion: add full support for completing busctl command lines, with services, objects, interfaces, members, and signatures 2014-12-23 22:44:32 +01:00
Zbigniew Jędrzejewski-Szmek 820aced6f6 zsh-completion: remove duplicate function
https://bugs.archlinux.org/task/43069
2014-12-10 17:34:56 -05:00
Ronny Chevalier 409886c424 shell-completion: systemctl edit 2014-12-10 01:10:01 +01:00
Lennart Poettering 25fa306ed5 hostnamed: introduce new "embedded" chassis type
We really don't want to get lost in adding fridge, car, plane, drone, or
whatever else, hence add a generic term "embedded" cover all the cases
where the computer is just part of something bigger, and not at the
focus of things.
2014-11-06 14:37:12 +01:00
Zbigniew Jędrzejewski-Szmek 81333ecf9d zsh-completion: update start/restart completions
Now zsh should behave the same for those two subcommands as bash.
2014-10-29 23:48:10 -04: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
Eric Cook c2026f28bd 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
2014-09-27 19:57:04 +02:00
Daniel Buch d6bc8348d5 readahead: wipe out readahead 2014-09-25 16:39:18 +02: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
Eric Cook 6d314eca15 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
2014-07-26 15:08:41 -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 be8f4a9fa7 bash-completion: -p option for journalctl 2014-07-19 19:47:10 -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
Zbigniew Jędrzejewski-Szmek ccb03ac39d shell-completion: add hostnamectl set-deployment 2014-07-11 09:22:01 -04:00
Zbigniew Jędrzejewski-Szmek 1ed7749564 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.
2014-07-11 09:22:00 -04:00
Lennart Poettering f4bab1690e coredump: coredumpctl is so useful now, make it a first-class citizen
Drop the "systemd-" prefix, renaming it from "systemd-coredumpctl" to
"coredumpctl".
2014-06-19 13:46:01 +02:00
Dan Kilman a163b64c4b bash completion: fix __get_startable_units 2014-04-13 11:39:43 -04:00
Thomas Hindoe Paaboel Andersen 5ba85788ab bash completion: add -i/--image to nspawn 2014-04-11 00:49:05 +02:00
Kay Sievers 51e430a5b0 bash_completion: busctl - add support for --user mode 2014-04-04 08:24:22 -04:00
Thomas Hindoe Paaboel Andersen 085ebc1b22 bash completion: Add -r/--recursive to systemctl 2014-04-03 22:54:41 +02:00
Daniel Mack 4433c995c7 completions: fix/augment zsh completions for systemd-nspawn, busctl, loginctl, hostnamectl, localectl, machinectl 2014-03-25 23:05:03 +01:00
Lennart Poettering 0088d63151 systemctl: --kill-mode is long long gone, don't mention it in the man page 2014-03-25 00:31:48 +01:00
Thomas Hindoe Paaboel Andersen 761a7c71b6 systemd-run: extend bash completion
--system
-H --host
-M --machine
--service-type (options: simple forking oneshot dbus notify idle)
--uid
--gid
--nice
--setenv
-p --property (options read from bus_append_unit_property_assignment)
2014-03-17 22:02:21 +01:00
Wieland Hoffmann 3a450ec5c6 _sd_machines: Use machinectl --no-legend
Otherwise bogus entries from the header and footer would show up in the
completion list.
2014-03-15 00:32:06 -04:00
Thomas Hindoe Paaboel Andersen 207017017d add bash completion for systemd-cat 2014-03-04 23:17:07 +01:00
Thomas Hindoe Paaboel Andersen 3bfe58cbd4 add bash completion for systemd-detect-virt 2014-03-03 22:18:37 +01:00
Thomas Hindoe Paaboel Andersen 64ae7f1864 update bash completion for systemd-analyze 2014-03-03 22:18:32 +01:00
Thomas Hindoe Paaboel Andersen d9256bac4d add bash completion for systemd-cgtop 2014-03-02 23:07:35 +01:00
Thomas Hindoe Paaboel Andersen abdab4f602 add bash completion for systemd-cgls 2014-03-01 23:10:38 +01:00
Thomas Andersen 0d6883b6a8 bash: add completion for systemd-nspawn 2014-03-01 03:30:41 +01:00
Lennart Poettering 538b08707a build-sys: add missing makefile symlinks 2014-02-26 02:19:28 +01:00
Jason St. John 90e633a790 replace tabs with spaces in some files
Files:
* hwdb/60-keyboard.hwdb
* shell-completion/zsh/_systemd-coredumpctl
* src/test/test-helper.h
2014-02-21 03:50:12 +01:00
Thomas Hindoe Paaboel Andersen 95fe27d930 bootctl: add bash completion 2014-02-20 23:13:11 +01:00
Thomas Hindoe Paaboel Andersen 17d47d8d2d busctl: add --no-legend and use in bash completion 2014-02-19 17:35:35 +01:00
Thomas Hindoe Paaboel Andersen 8ec76163ff busctl: update bash completion 2014-02-19 17:12:17 +01:00
Thomas Hindoe Paaboel Andersen 0bc8e31b35 delta: add bash completion 2014-02-18 22:34:59 +01:00
Thomas Hindoe Paaboel Andersen e56056e93d machinectl: add bash completion 2014-02-18 21:14:30 +01:00
Tom Gundersen d72143bad4 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.
2014-02-07 15:48:35 +01:00
Zbigniew Jędrzejewski-Szmek 627a98d398 shell-completion: fix completion of localectl set-locale
https://bugs.freedesktop.org/show_bug.cgi?id=74157
2014-02-06 12:01:39 -05:00
Zbigniew Jędrzejewski-Szmek 3ce09b7da2 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
2014-02-06 00:45:00 -05:00
Lukas Nykryn f89a4474e0 shell-completion: remove load from systemctl 2014-01-15 15:31:07 +01:00
Lennart Poettering b68b76897a Revert "completion: don't offer completions for journalctl -b"
This reverts commit c756a6d57c.
2013-12-26 01:53:07 +01:00
Dave Reisner c756a6d57c completion: don't offer completions for journalctl -b
Since this is a shortopt with an optional argument, assume the user
knows what they're doing. The longopts --boot and --this-boot will
continue to offer boot IDs as completions.
2013-12-25 12:58:37 -05:00
Zbigniew Jędrzejewski-Szmek 841aa8c0b4 loginctl,shell-completions: fix listing of sessions/users/seats 2013-12-21 18:35:27 -05:00
Jason St. John c736283bfb 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
2013-12-18 23:58:24 -05:00
Zbigniew Jędrzejewski-Szmek 86cb0691b7 shell-completion: busctl 2013-12-05 21:33:08 -05:00
Zbigniew Jędrzejewski-Szmek 6da49b8b2f shell-completion: systemctl cat
Also update -H help string to follow the binaries.
2013-11-30 22:36:08 -05:00
Zbigniew Jędrzejewski-Szmek 7524c3cf44 bash-completion: journalctl --file 2013-11-15 22:54:51 -05:00
Marko Myllynen 51d0f1c9f6 zsh-completion: add bootctl 2013-11-13 23:02:23 -05:00
Dave Reisner d181115929 shell: add list-timers to systemctl completions 2013-11-11 11:04:06 -05:00
William Giokas c0fd7cbd7a zsh-completion: Move machine listing to autoload
Instead of having two different listings of machines, use an autoloaded
function that can be used by other shell completions in the future. It
will also allow editing a single file to change the way machinectl and
systemd-run completion for machines.
2013-11-09 19:02:53 -05:00
William Giokas a02c5fe7cb zsh-completion: Move output modes to autoload 2013-11-09 19:02:53 -05:00
Ronny Chevalier f49e8bc472 zsh-completion: add missing options for systemd-run 2013-11-07 01:23:54 -05:00
Ronny Chevalier d74ab85216 zsh-completion: add systemd-run 2013-10-30 22:45:18 -04: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
Zbigniew Jędrzejewski-Szmek f11880744c 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.
2013-10-28 23:43:57 -04:00
Zbigniew Jędrzejewski-Szmek 299c397c12 shell-completion: dump has moved to systemd-analyze
Rename NO_OPTION to STANDALONE for consistency with other files.
2013-10-21 18:53:57 -04: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
William Giokas 4a8fa99069 zsh_completion: Fix journalctl's --boot
Actually displays a list of boot ID's and offsets to the user
2013-08-02 10:44:10 -04:00
William Giokas c51fa9dd4e zsh_completion: Remove unused functions 2013-08-02 10:44:07 -04:00
William Giokas 439b7ce868 zsh_completion: Split out zsh _machinectl 2013-08-02 10:44:03 -04:00
William Giokas 7abfbe7903 zsh_completion: Split out zsh _systemd-analyze 2013-08-02 10:43:58 -04:00
William Giokas 67e654f830 zsh_completion: Split out zsh _systemd-inhibit 2013-08-02 10:43:55 -04:00
William Giokas 30fd4d1eb1 zsh_completion: Split out zsh _systemd-nspawn
Also fix the random lack of completion
2013-08-02 10:43:52 -04:00
William Giokas a06225fcc1 zsh_completion: Split out zsh _udevadm 2013-08-02 10:43:49 -04:00
William Giokas 20c8382ba7 zsh_completion: Split out zsh _timedatectl 2013-08-02 10:43:46 -04:00
William Giokas 70e104c4e3 zsh_completion: Split out zsh _coredumpctl 2013-08-02 10:43:42 -04:00
William Giokas c4c12f133e zsh_completion: Split out zsh _localectl 2013-08-02 10:43:39 -04:00
William Giokas 7e83c0e03f zsh_completion: Split out zsh _journalctl
Re-ordered some of the options and added a few that were missing
previously as well.
2013-08-02 10:43:35 -04:00
William Giokas db456cd0c6 zsh_completion: Split out zsh _hostnamectl 2013-08-02 10:43:31 -04:00
William Giokas 799d54be0b zsh_completion: Split out zsh _loginctl 2013-08-02 10:43:27 -04:00
William Giokas ff7a0685a9 zsh_completion: Split out zsh _systemctl 2013-08-02 10:43:22 -04:00
William Giokas 4f87c47b35 zsh_completion: fix zsh completion installation
Moved zsh shell completion to shell-completion/zsh/_systemd for
automake's sake. Also allow users to specify where the files should go
with::

  ./configure --with-zshcompletiondir=/path/to/some/where

and by default going to `$datadir/zsh/site-functions`
2013-08-02 10:43:08 -04:00
Dave Reisner b5b7ea7503 bash-completion: simplify udevadm completion
The AA is unnecessary and only adds needless complexity. Replace it
with a case statement instead of repeatedly calling __contains_word to
overglorify string equalities.
2013-07-30 13:04:46 -04:00
Dave Reisner a72d698d0d bash-completion: use a better definition of __contains_word
- scope the iterator var
- use the correct, quoted, non-expansion prone positional parameter
  notation
- prevent expansion on RHS of comparison
- remove unneeded explicit returns.

This really should be defined only once...
2013-07-30 13:04:46 -04:00
Harald Hoyer e861b62154 simplify bash completion for kernel-install 2013-07-30 09:46:06 +02:00
Kay Sievers 819da59577 shell-completion: add kernel-install 2013-07-26 02:40:09 +02:00
Dave Reisner 5c7951141f tmpfiles: introduce --exclude-prefix
The opposite of --prefix, allows specifying path prefixes which should
be skipped when processing rules.
2013-07-24 12:04:00 -04:00
William Giokas 80d39fbb3e shell-completion: Add machinectl zsh completion 2013-07-24 09:11:36 -04:00
Jan Janssen a331b5e6d4 journalctl: Add support for showing messages from a previous boot
Hi,

I redid the boot ID look up to use enumerate_unique.

This is quite fast if the cache is warm but painfully slow if
it isn't. It has a slight chance of returning the wrong order if
realtime clock jumps around.

This one has to do n searches for every boot ID there is plus
a sort, so it depends heavily on cache hotness. This is in contrast
to the other way of look-up through filtering by a MESSAGE_ID,
which only needs about 1 seek + whatever amount of relative IDs
you want to walk.

I also have a linked-list + (in-place) mergesort version of this
patch, which has pretty much the same runtime. But since this one
is using libc sorting and armortized allocation, I prefer this
one.

To summarize: The MESSAGE_ID way is a *lot* faster but can be
incomplete due to rotation, while the enumerate+sort will find
every boot ID out there but will be painfully slow for large
journals and cold caches.

You choose :P

Jan
2013-07-16 17:38:12 +02:00
Kay Sievers 9d7d42bc40 udev: add builtin 'keyboard' to manage key mappings 2013-07-10 22:52:55 +02:00
Daniel Albers 98a6e132b5 journalctl,loginctl,systemctl,systemd-cgls: add -l as alias for --full
https://bugs.freedesktop.org/show_bug.cgi?id=65850
2013-06-17 10:33:34 -04:00
Zbigniew Jędrzejewski-Szmek 3f3a438f58 journalctl: add --system/--user flags
--user basically gives messages from your own systemd --user services.
--system basically gives messages from PID 1, kernel, and --system
services. Those two options are not exahustive, because a priviledged
user might be able to see messages from other users, and they will not
be shown with either or both of those flags.
2013-06-10 10:10:06 -04:00
Václav Pavlín 99504dd4c1 systemctl: add commands set-default and get-default
systemctl set-default NAME links the default.target to the given unit,
get-default prints out the path to the currently set default target.
2013-05-30 20:44:41 -04:00
Daniel Wallace 9494131b91 zsh_completion: complete only pids for systemd-coredumpctl
Instead of completing the whole line, which doesn't work, only complete
the pid, but still show the whole line so the user can see which command
was which.

Users can also let the parameter expansion sort the completion by date
instead of by pid, by setting

zstyle ':completion:*:*:systemd-coredumpctl:*' sort no

so that the zshcompsys doesn't sort the _describe function for only
systemd-coredumpctl.
2013-05-06 22:49:15 +02:00
Daniel Wallace 57277cbe40 zsh_completion: fix udevadm monitor flags
The brackets in the _arguments description of udevadm monitor need to be
escaped.
2013-05-01 10:15:25 -04:00
Zbigniew Jędrzejewski-Szmek 96de7c047f zsh-completion: add s-a critical-chain 2013-05-01 09:59:24 -04:00
Harald Hoyer bb150966c0 systemd-analyse: add "critical-chain" command
"critical-chain" prints a tree of the critical chain of units

$ ./systemd-analyze critical-chain
graphical.target @1.226s
└─multi-user.target @1.226s
  └─nfs-lock.service @961ms +265ms
    └─rpcbind.service @958ms +1ms
      └─network.target @957ms
        └─NetworkManager.service @434ms +522ms
          └─basic.target @428ms
            └─sockets.target @428ms
              └─dbus.socket @428ms
                └─sysinit.target @427ms
                  └─systemd-tmpfiles-setup.service @411ms +15ms
                    └─local-fs.target @410ms
                      └─boot-efi.automount @410ms
                        └─boot.mount @397ms +9ms
                          └─local-fs-pre.target @192ms
                            └─systemd-udevd.service @187ms +5ms
                              └─systemd-udevd-control.socket @140ms
                                └─-.mount

With the "--fuzz=<ms>" parameter one can display more units around
the critical units.

$ ./systemd-analyze --fuzz=10ms critical-chain
└─multi-user.target @1.226s
  └─nfs-lock.service @961ms +265ms
    ├─rpcbind.service @958ms +1ms
    │ └─network.target @957ms
    │   └─NetworkManager.service @434ms +522ms
    │     ├─basic.target @428ms
    │     │ ├─sockets.target @428ms
    │     │ │ ├─dbus.socket @428ms
    │     │ │ │ └─sysinit.target @427ms
    │     │ │ │   ├─systemd-tmpfiles-setup.service @411ms +15ms
    │     │ │ │   │ └─local-fs.target @410ms
    │     │ │ │   │   └─boot-efi.automount @410ms
    │     │ │ │   │     └─boot.mount @397ms +9ms
    │     │ │ │   │       └─local-fs-pre.target @192ms
    │     │ │ │   │         └─systemd-udevd.service @187ms +5ms
    │     │ │ │   │           ├─systemd-udevd-control.socket @140ms
    │     │ │ │   │           │ └─-.mount
    │     │ │ │   │           └─systemd-udevd-kernel.socket @140ms
    │     │ │ │   └─swap.target @421ms
    │     │ │ │     └─dev-disk-by\x2duuid-....swap @414ms +6ms
    │     │ │ │       └─systemd-journald.socket
    │     │ │ ├─rpcbind.socket @428ms
    │     │ │ └─cups.socket @428ms
    │     │ ├─paths.target @428ms
    │     │ │ └─cups.path @428ms
    │     │ ├─timers.target @427ms
    │     │ │ └─systemd-tmpfiles-clean.timer @427ms
    │     │ └─sysinit.target @427ms
    │     │   └─...
    │     └─dbus.socket @428ms
    │       └─...
    └─network.target @957ms
      └─...
2013-04-26 13:34:22 +02:00
Harald Hoyer 83cb95b530 add bash completion for systemd-analyze 2013-04-24 16:49:33 +02:00
Zbigniew Jędrzejewski-Szmek afba41995d systemctl: show reverse dependencies or before/after ordering
Also update completion scripts a bit.
2013-04-24 00:25:04 -04:00
Harald Hoyer bf83067c1d shell-completion: add shell completion for "systemctl help" 2013-04-22 11:39:19 +02:00
Zbigniew Jędrzejewski-Szmek 90cf049bfe shell-completion: use -a to see "empty" properties 2013-04-17 10:53:18 -04:00
Zbigniew Jędrzejewski-Szmek caffaf5859 bash-completion: --property support
Just bash.
2013-04-17 00:09:16 -04:00
Zbigniew Jędrzejewski-Szmek 20b3f379cf systemctl: allow multiple arguments to --type
This mirrors --property, and is generally useful.

New functionality is used in bash completion.

In case of zsh completion, new functionality is less useful
because of caching. Nevertheless, zsh completion for restart
is made to behave more-or-less the same as bash completion.
At least sockets can be restarted.
2013-04-11 19:11:52 -04:00
Zbigniew Jędrzejewski-Szmek c2e09812e9 shell-completion: show failed units as candidates for start
Also show disabled units as candidates for reenable,
since it works and one may want to do enable-or-reenable
in one line.
2013-04-10 19:47:21 -04:00
Zbigniew Jędrzejewski-Szmek 79c1638303 shell-completion: replace printf with echo
It is faster to use a bash built-in, then to invoke an external
program. The problem of unit names starting with a dash is solved
by prepending a space. Spaces are ignored anyway.

For zsh, replace echo "$unit", which is vulnerable to dashes,
with echo " $unit".
2013-04-10 19:47:16 -04:00
Zbigniew Jędrzejewski-Szmek 9e542e0b3a shell-completion: work on session shell is --user is used
https://bugs.freedesktop.org/show_bug.cgi?id=61695
2013-04-05 11:44:01 -04:00
Tollef Fog Heen 6af274272a Drop trailing whitespace 2013-03-22 22:51:52 +01:00
Tom Gundersen c4b5cf8763 zsh completion: udev - remove firmware builtin 2013-03-20 13:41:43 +01:00
Harald Hoyer 1535fb7379 shell-completion/bash/journalctl: suppress stderr 2013-03-19 15:04:02 +01:00
Tom Gundersen a3bd8447be udev: make firmware loading optional and disable by default
Distros that whish to support old kernels should set
  --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware"
to retain the old behaviour.
2013-03-18 15:19:51 +01:00
Daniel Wallace 646614a407 zsh-completion: journalctl query by binary and device
implement 1883552c3d from bash completion in zsh-completion
2013-03-05 21:04:15 +01:00
Michael Biebl d611dadcc7 bash-completion: split completions and move to new location
Split the large bash completion script into separate, smaller files each
named after the binary it is used for and move the files to
/usr/share/bash-completion/completions. This way the completions can be
loaded on demand and we only install the completions for the tools we
actually build. The old path /etc/bash_completion.d/ is deprecated and
will disappear in the future.
2013-03-03 14:39:51 +01:00
Daniel Wallace ffa7cd15cd journalctl: add --user-unit= switch
Add --user-unit= to make it possible to query for user logs by the name
of the service.
2013-03-01 14:39:04 +01:00
Zbigniew Jędrzejewski-Szmek 1883552c3d bash-completion: journalctl query by binary and device
The approach taken is different between the two:
- since there are many files in /usr, but messages appear
  only for a tiny subset, the completion is performed
  only for stuff shown by journalctl -F _EXE. This makes
  sense because the list is already in proper form.
- since it is hard to convert _KERNEL_DEVICE to device
  file name, simply all files in /dev/ are used as possible
  completions.

Unfortunately zsh completion requires more work and is not
covered by this commit.
2013-02-26 23:16:58 -05:00
Simon Peeters 1700761b06 Move systemctl dot to systemd-analyze dot 2013-02-13 14:47:05 -08:00
Thomas Hindoe Paaboel Andersen 1a0fce458d systemctl: add is-failed
Adds is-failed to join is-active and is-enabled.

I grabbed this one from the todo list. Most of the functionality was
already there for is-active. I just needed to make check_one_unit take
the states to check for as an argument instead of the hardcoded
"active" and "reloading".

is-failed will return 1 if none of the units given are failed. This is
different from is-active which will return 3 if none of the units
given are active. It returns 3 with this comment:
/* According to LSB: "program is not running" */
As that does not make sense when looking for failed units I simply
chose 1 instead.
2013-01-04 00:33:25 +01:00
Daniel Wallace f897e86278 zsh: add hibernate and hybrid-sleep to zsh-completion 2012-12-19 20:45:52 +01:00
Dave Reisner 45db2956ba bash-completion: update list of verbs
Add suspend, hibernate, hybrid-sleep
2012-12-19 08:11:20 -05:00
Umut Tezduyar d9847b3246 systemctl: fix typos in help text 2012-12-03 16:05:01 +01:00
Daniel Wallace 10341c618e fix --full for journalctl zsh completion 2012-11-24 01:42:35 +01:00
Kay Sievers 66128b2b4d shell-completion: udev - add net_id 2012-11-20 18:08:48 +01:00
Zbigniew Jędrzejewski-Szmek e3657ecd7f journalctl: add option to forgo ellipsization
Sometimes it is better to see messages in full, and the existing
set of options didn't allow this easily. E.g. now

  journalctl -f --full

will behave like

  tail -f /var/log/messages

of yore.

Long option only for now, since small letters are becoming
scarce, and this doesn't feel like a capital-letter-option.
'-u' would be nice, and the above command would be spelled

  journalctl -fu
2012-11-17 15:32:04 +01:00
Zbigniew Jędrzejewski-Szmek 12514db7d0 shell-completion: add catalog options 2012-11-16 23:41:58 +01:00
Dave Reisner 253a87510b bash-completion: add 'gdb' verb for coredumpctl
This also fixes value completion for journal fields, as the completion
for the RHS of the '=' was missing when it was borrowed from journalctl.
2012-11-09 14:12:36 -05:00
Daniel Wallace 553b932366 add zsh completion for all the commands
Most of the completion for systemctl and loginctl provided by Foudil Brétel
2012-11-05 10:56:28 +01:00
Kay Sievers bd49c40537 bash-completion > shell-completion 2012-11-03 22:10:32 +01:00