Parent directory

_security

4497 bytes
 1#compdef security
 2
 3local -a _1st_arguments
 4_1st_arguments=(
 5  'help:Show all commands, or show usage for a command'
 6  'list-keychains:Display or manipulate the keychain search list'
 7  'default-keychain:Display or set the default keychain'
 8  'login-keychain:Display or set the login keychain'
 9  'create-keychain:Create keychains and add them to the search list'
10  'delete-keychain:Delete keychains and remove them from the search list'
11  'lock-keychain:Lock the specified keychain'
12  'lock-keychain:Unlock the specified keychain'
13  'set-keychain-settings:Set settings for a keychain'
14  'set-keychain-password:Set password for a keychain'
15  'show-keychain-info:Show the settings for keychain'
16  'dump-keychain:Dump the contents of one or more keychains'
17  'create-keypair:Create an asymmetric key pair'
18  'add-generic-password:Add a generic password item'
19  'add-internet-password:Add an internet password item'
20  'add-certificates:Add certificates to a keychain'
21  'find-generic-password:Find a generic password item'
22  'delete-generic-password:Delete a generic password item'
23  'find-internet-password:Find an internet password item'
24  'delete-internet-password:Delete an internet password item'
25  'find-certificate:Find a certificate item'
26  'find-identity:Find an identity certificate + private key'
27  'delete-certificate:Delete a certificate from a keychain'
28  'set-identity-preference:Set the preferred identity to use for a service'
29  'get-identity-preference:Get the preferred identity to use for a service'
30  'create-db:Create a db using the DL'
31  'export:Export items from a keychain'
32  'import:Import items into a keychain'
33  'cms:Encode or decode CMS messages'
34  'install-mds:MDS database'
35  'add-trusted-cert:Add trusted certificates:'
36  'remove-trusted-cert:Remove trusted certificates:'
37  'dump-trust-settings:Display contents of trust settings'
38  'user-trust-settings-enable:Display or manipulate user-level trust settings'
39  'trust-settings-export:Export trust settings'
40  'trust-settings-import:Import trust settings'
41  'verify-cert:Verify certificates:'
42  'authorize:Perform authorization operations'
43  'authorizationdb:Make changes to the authorization policy database'
44  'execute-with-privileges:Execute tool with privileges'
45  'leaks:Run /usr/bin/leaks on this process'
46  'error:Display a descriptive message for the given error codes:'
47  'create-filevaultmaster-keychain:"Create a keychain containing a key pair for FileVault recovery use'
48)
49_arguments '*:: :->command'
50
51if (( CURRENT == 1 )); then
52  _describe -t commands "security command" _1st_arguments
53  return
54fi
55
56case "$words[1]" in
57  find-(generic|internet)-password)
58    _values \
59      'Usage: find-[internet/generic]-password [-a account] [-s server] [options...] [-g] [keychain...]' \
60      '-a[Match "account" string]' \
61      '-c[Match "creator" (four-character code)]' \
62      '-C[Match "type" (four-character code)]' \
63      '-D[Match "kind" string]' \
64      '-G[Match "value" string (generic attribute)]' \
65      '-j[Match "comment" string]' \
66      '-l[Match "label" string]' \
67      '-s[Match "service" string]' \
68      '-g[Display the password for the item found]' \
69      '-w[Display only the password on stdout]' ;;
70  add-(generic|internet)-password)
71    _values \
72      'Usage: add-[internet/generic]-password [-a account] [-s server] [-w password] [options...] [-A|-T appPath] [keychain]]' \
73      '-a[Specify account name (required)]' \
74      '-c[Specify item creator (optional four-character code)]' \
75      '-C[Specify item type (optional four-character code)]' \
76      '-d[Specify security domain string (optional)]' \
77      '-D[Specify kind (default is "Internet password")]' \
78      '-j[Specify comment string (optional)]' \
79      '-l[Specify label (if omitted, server name is used as default label)]' \
80      '-p[Specify path string (optional)]' \
81      '-P[Specify port number (optional)]' \
82      '-r[Specify protocol (optional four-character SecProtocolType, e.g. "http", "ftp ")]' \
83      '-s[Specify server name (required)]' \
84      '-t[Specify authentication type (as a four-character SecAuthenticationType, default is "dflt")]' \
85      '-w[Specify password to be added]' \
86      '-A[Allow any application to access this item without warning (insecure, not recommended!)]' \
87      '-T[Specify an application which may access this item (multiple -T options are allowed)]' \
88      '-U[Update item if it already exists (if omitted, the item cannot already exist) ]' \
89      'utils)]' ;;
90esac