bash-completion.sh
branchv_0
changeset 38 2cc2d3f658f4
parent 31 c22577615ce4
child 39 f33464965693
equal deleted inserted replaced
37:5dcff3c35462 38:2cc2d3f658f4
    25 	BOOLEAN_VALUES=(
    25 	BOOLEAN_VALUES=(
    26 		"true"
    26 		"true"
    27 		"false"
    27 		"false"
    28 	)
    28 	)
    29 
    29 
       
    30 	TABLE_STYLES=(
       
    31 		"rounded"
       
    32 		"sharp"
       
    33 		"sharp-double"
       
    34 		"horizontal-only"
       
    35 		"ascii"
       
    36 	)
       
    37 
       
    38 	COLOR_SCHEMES=(
       
    39 		"green-screen"
       
    40 		"monochrome"
       
    41 		"midnight"
       
    42 	)
       
    43 
    30 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    44 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("'.+'")
    31 	elif [[ "$w1" == "--write-types"                                    ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    45 	elif [[ "$w1" == "--write-types"                                    ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    32 	elif [[ "$w1" == "--write-relation-name"                            ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    46 	elif [[ "$w1" == "--write-relation-name"                            ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    33 	elif [[ "$w1" == "--write-record-count"                             ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
    47 	elif [[ "$w1" == "--write-record-count"                             ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
       
    48 	elif [[ "$w1" == "--table-style"                                    ]];    then COMPREPLY=($(compgen -W "${TABLE_STYLES[*]}" -- "$w0"))
       
    49 	elif [[ "$w1" == "--color-scheme"                                    ]];    then COMPREPLY=($(compgen -W "${COLOR_SCHEMES[*]}" -- "$w0"))
    34 	else
    50 	else
    35 		OPTIONS=(
    51 		OPTIONS=(
    36 			"--relation"
    52 			"--relation"
    37 			"--write-types"
    53 			"--write-types"
    38 			"--write-relation-name"
    54 			"--write-relation-name"
    39 			"--write-record-count"
    55 			"--write-record-count"
       
    56 			"--table-style"
       
    57 			"--color-scheme"
    40 		)
    58 		)
    41 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    59 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
    42 	fi
    60 	fi
    43 }
    61 }
    44 
    62