offer to remove only those values that are defined

This commit is contained in:
Valentin Haenel
2015-02-13 22:26:17 +01:00
parent cf606c9cd9
commit 19dd8922f3

10
_conda
View File

@@ -107,7 +107,13 @@ values = json.load(sys.stdin)['get']['$search_term']
for v in values:
print(v)
"))
print $config_values
print -l $config_values
}
__conda_config_values_describe(){
local -a config_values
config_values=($( __conda_config_values $1 ))
_describe -t config_values 'configuration values' config_values
}
__conda_channels(){
@@ -327,7 +333,7 @@ case $state in
'( --add --set --remove --remove-key)--get[get the configuration value]:key:__conda_config' \
'(--get --set --remove --remove-key)--add[add one configuration value to a list key]:key:__conda_config:value:' \
'(--get --add --remove --remove-key)--set[set a boolean key]:key:__conda_config:value:' \
'(--get --add --set --remove-key)--remove[remove a configuration value from a list key]:key:__conda_config:value' \
'(--get --add --set --remove-key)--remove[remove a configuration value from a list key]:key:__conda_config:value:{__conda_config_values_describe '$last_item'}' \
'(--get --add --set --remove )--remove-key[remove a configuration key (and all its values)]:key:__conda_config' \
'(-f --force)'{-f,--force}'[write to the config file using the yaml parser]' \
$get_opts