diff options
Diffstat (limited to 'share/functions/__fish_systemctl_snapshots.fish')
-rw-r--r-- | share/functions/__fish_systemctl_snapshots.fish | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/share/functions/__fish_systemctl_snapshots.fish b/share/functions/__fish_systemctl_snapshots.fish new file mode 100644 index 00000000..7b6cb5ee --- /dev/null +++ b/share/functions/__fish_systemctl_snapshots.fish @@ -0,0 +1,12 @@ +function __fish_systemctl_snapshots + if type -q systemctl + if __fish_contains_opt user + # Snapshots are usually generated at runtime + # Therefore show known _units_, not unit-files + # They are also often not loaded, so add "--all" + systemctl --user list-units --all --no-legend --type=snapshot ^/dev/null | cut -f 1 -d ' ' + else + systemctl list-units --all --no-legend --type=snapshot ^/dev/null | cut -f 1 -d ' ' + end + end +end |