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