about summary refs log tree commit diff
path: root/Completion/Unix/Command/_uname
blob: c58f2edfda7b5a0f66ac0558e464b6fd9e942274 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#compdef uname guname

typeset -A _uname_args
local -a args

case $LANG in
  de_*)
    _uname_args=(
      all               "alle Grundinformationen ausgeben"
      kernel-name       "Namen des Kernels ausgeben"
      nodename          "Netzwerknamen der Maschine ausgeben"
      kernel-release    "Release-Nummer des Kernels ausgeben"
      kernel-version    "Version des Kernels ausgeben"
      os-release        "Release-Nummer des Betriebssystems ausgeben"
      machine           "Maschinentyp (Hardware) ausgeben"
      processor         "Typ des Prozessors ausgeben"
      hardware-platform "Hardwareplattform ausgeben"
      operating-system  "Namen des Betriebssystems ausgeben"
      help              "Hilfe anzeigen und beenden"
      version           "Versionsinformation anzeigen und beenden"
    )
  ;;
  (*)
    _uname_args=(
      all               "print all basic information"
      kernel-name       "print kernel name"
      nodename          "print network node hostname"
      kernel-release    "print kernel release"
      kernel-version    "print kernel version"
      os-release        "print operating system release level"
      machine           "print machine hardware name"
      processor         "print processor type"
      hardware-platform "print hardware platform"
      operating-system  "print name of the operating system"
      help              "display help information"
      version           "output version information and exit"
    )
  ;;
esac

if _pick_variant gnu="Free Soft" unix --version; then
  _arguments -s \
    '(-)'{--all,-a}'['$_uname_args[all]']' \
    '(--kernel-name -s)'{--kernel-name,-s}'['$_uname_args[kernel-name]']' \
    '(--nodename -n)'{--nodename,-n}'['$_uname_args[nodename]']' \
    '(--kernel-release -r)'{--kernel-release,-r}'['$_uname_args[kernel-release]']' \
    '(--kernel-version -v)'{--kernel-version,-v}'['$_uname_args[kernel-version]']' \
    '(--machine -m)'{--machine,-m}'['$_uname_args[machine]']' \
    '(--processor -p)'{--processor,-p}'['$_uname_args[processor]']' \
    '(--hardware-platform -i)'{--hardware-platform,-i}'['$_uname_args[hardware-platform]']' \
    '(--operating-system -o)'{--operating-system,-o}'['$_uname_args[operating-system]']' \
    '(-)--help['$_uname_args[help]']' \
    '(-)--version['$_uname_args[version]']'
else
  args=(
    "(-m -n -r -s -v)-a[${_uname_args[all]}]"
    '-m[print hardware class]'
    "-n[${_uname_args[nodename]}]"
    "-p[${_uname_args[processor]}]"
    "-r[${_uname_args[os-release]}]"
    "-s[${_uname_args[operating-system]}]"
    '-v[print detailed operating system version]'
  )
  case $OSTYPE in
    freebsd*|dragonfly*)
      args+=(
        '-i[print kernel ident]'
        '-K[print kernel version]'
        '-U[print user environment version]'
      )
    ;|
    dragonfly*)
      args+=(
        '-P[write ABI string for dports / pkgng, including odd-to-even version-munging]'
        '-PP[write ABI string for dports / pkgng, without version-munging]'
      )
    ;;
    freebsd<13->.*)
      args+=( "-b[print kernel's linker-generated build-id]" )
    ;;
    solaris*)
      args+=(
        '-i[print platform name]'
	'-S[set system name]:system name'
        '-X[print expanded system information]'
      )
    ;;
  esac
  _arguments -s $args
fi