File: __fish_complete_groups.fish

package info (click to toggle)
fish 4.2.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 35,980 kB
  • sloc: python: 6,972; javascript: 1,407; sh: 1,009; xml: 411; ansic: 230; objc: 78; makefile: 20
file content (12 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
# localization: skip(private)
function __fish_complete_groups --description "Print a list of local groups, with group members as the description"
    if command -sq getent
        getent group | while read -l line
            string split -f 1,4 : -- $line | string join \t
        end
    else
        while read -l line
            string split -f 1,4 : -- $line | string join \t
        end </etc/group
    end
end