bash-completion.sh
branchv_0
changeset 29 6f15f18d2abf
parent 28 9172bd97ae99
child 31 c64e1588f428
equal deleted inserted replaced
28:9172bd97ae99 29:6f15f18d2abf
    52 		"dublincore.title"
    52 		"dublincore.title"
    53 		"dublincore.creator"
    53 		"dublincore.creator"
    54 		"dublincore.rights"
    54 		"dublincore.rights"
    55 	)
    55 	)
    56 
    56 
    57 	HASH_FIELDS=(
       
    58 		"md5"
       
    59 		"sha1"
       
    60 		"sha256"
       
    61 		"sha512"
       
    62 	)
       
    63 
       
    64 
       
    65 	if   [[ "$w1" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    57 	if   [[ "$w1" == "--relation"      && "x$w0" == "x" ]];    then COMPREPLY=("''")
    66 	elif [[ "$w1" == "--as"            && "x$w0" == "x" ]];    then COMPREPLY=("''")
    58 	elif [[ "$w1" == "--as"            && "x$w0" == "x" ]];    then COMPREPLY=("''")
    67 	elif [[ "$w1" == "--option"        && "x$w0" == "x" ]];    then COMPREPLY=("''")
    59 	elif [[ "$w1" == "--option"        && "x$w0" == "x" ]];    then COMPREPLY=("''")
    68 	elif [[ "$w2" == "--option"        && "x$w0" == "x" ]];    then COMPREPLY=("''")
    60 	elif [[ "$w2" == "--option"        && "x$w0" == "x" ]];    then COMPREPLY=("''")
    69 	elif [[ "$w1" == "--file"                           ]];    then COMPREPLY=($(compgen -W "${FILE_FIELDS[*]}"  -- "$w0"))
    61 	elif [[ "$w1" == "--file"                           ]];    then COMPREPLY=($(compgen -W "${FILE_FIELDS[*]}"  -- "$w0"))
    70 	elif [[ "$w1" == "--xattr"                          ]];    then COMPREPLY=($(compgen -W "${XATTR_FIELDS[*]}" -- "$w0"))
    62 	elif [[ "$w1" == "--xattr"                          ]];    then COMPREPLY=($(compgen -W "${XATTR_FIELDS[*]}" -- "$w0"))
    71 	elif [[ "$w1" == "--hash"                           ]];    then COMPREPLY=($(compgen -W "${HASH_FIELDS[*]}" -- "$w0"))
    63 	elif [[ "$w1" == "--exec"                           ]];    then COMPREPLY=($(compgen -W "$(_relpipe_in_filesystem_scripts)" -- "$w0"))
    72 	elif [[ "$w1" == "--script"                         ]];    then COMPREPLY=($(compgen -W "$(_relpipe_in_filesystem_scripts)" -- "$w0"))
       
    73 	else
    64 	else
    74 		OPTIONS=(
    65 		OPTIONS=(
    75 			"--relation"
    66 			"--relation"
    76 			"--file"
    67 			"--file"
    77 			"--xattr"
    68 			"--xattr"
    78 			"--hash"
    69 			"--exec"
    79 			"--script"
       
    80 			"--as"
    70 			"--as"
    81 			"--option"
    71 			"--option"
    82 		)
    72 		)
    83 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    73 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    84 	fi
    74 	fi