From 19dd8922f3c9e60c7de034d12aaade9dcf115c3d Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Fri, 13 Feb 2015 22:26:17 +0100 Subject: [PATCH] offer to remove only those values that are defined --- _conda | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/_conda b/_conda index 409dd64..032b2a4 100644 --- a/_conda +++ b/_conda @@ -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