2016-06-07 22:50:28 +08:00
|
|
|
|
2016-06-08 20:30:39 +08:00
|
|
|
# Checks if we are using GNU tools
|
2018-04-02 04:42:38 +08:00
|
|
|
if mkdir --version > /dev/null 2>/dev/null
|
2017-10-12 01:17:35 +08:00
|
|
|
complete -c mkdir -l version -d 'Output version'
|
|
|
|
complete -c mkdir -s m -l mode -d 'Set file mode (as in chmod)' -x
|
|
|
|
complete -c mkdir -s p -l parents -d 'Make parent directories as needed'
|
|
|
|
complete -c mkdir -s v -l verbose -d 'Print a message for each created directory'
|
|
|
|
complete -c mkdir -l help -d 'Display help'
|
2016-06-07 22:50:28 +08:00
|
|
|
|
2016-06-08 20:30:39 +08:00
|
|
|
else
|
2017-10-12 01:17:35 +08:00
|
|
|
complete -c mkdir -s m -d 'Set file mode (as in chmod)' -x
|
|
|
|
complete -c mkdir -s p -d 'Make parent directories as needed'
|
|
|
|
complete -c mkdir -s v -d 'Print a message for each created directory'
|
2016-06-08 20:30:39 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
# Checks if SELinux is installed
|
2018-04-02 04:42:38 +08:00
|
|
|
if command -s sestatus > /dev/null 2>/dev/null
|
2017-10-12 01:17:35 +08:00
|
|
|
complete -c mkdir -l context -s Z -d 'Set SELinux security context of each created directory to the default type'
|
2016-06-08 20:30:39 +08:00
|
|
|
end
|