Clarify the remove keystore command can handle many (#54244)

The remove keystore command can handle multiple settings. In a few
places, we were not consistent about mentioning this. This commit
addreses this, in the CLI help, and the docs.
This commit is contained in:
Jason Tedor 2020-03-26 08:49:05 -04:00
parent b11960e3e6
commit d8f745736b
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5
2 changed files with 13 additions and 4 deletions

View File

@ -72,7 +72,7 @@ can optionally use an empty string to remove the password. If the keystore is
not password protected, you can use this command to set a password. not password protected, you can use this command to set a password.
`remove <settings>`:: Removes settings from the keystore. Multiple setting `remove <settings>`:: Removes settings from the keystore. Multiple setting
names can be specified as arguments to the `add` command. names can be specified as arguments to the `remove` command.
`-s, --silent`:: Shows minimal output. `-s, --silent`:: Shows minimal output.
@ -204,6 +204,15 @@ To remove a setting from the keystore, use the `remove` command:
bin/elasticsearch-keystore remove the.setting.name.to.remove bin/elasticsearch-keystore remove the.setting.name.to.remove
---------------------------------------------------------------- ----------------------------------------------------------------
You can also remove multiple settings with the `remove` command:
[source,sh]
----------------------------------------------------------------
bin/elasticsearch-keystore remove \
the.setting.name.to.remove \
the.other.setting.name.to.remove
----------------------------------------------------------------
If the {es} keystore is password protected, you are prompted to enter the If the {es} keystore is password protected, you are prompted to enter the
password. password.

View File

@ -19,8 +19,6 @@
package org.elasticsearch.common.settings; package org.elasticsearch.common.settings;
import java.util.List;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import joptsimple.OptionSpec; import joptsimple.OptionSpec;
import org.elasticsearch.cli.ExitCodes; import org.elasticsearch.cli.ExitCodes;
@ -28,6 +26,8 @@ import org.elasticsearch.cli.Terminal;
import org.elasticsearch.cli.UserException; import org.elasticsearch.cli.UserException;
import org.elasticsearch.env.Environment; import org.elasticsearch.env.Environment;
import java.util.List;
/** /**
* A subcommand for the keystore cli to remove a setting. * A subcommand for the keystore cli to remove a setting.
*/ */
@ -36,7 +36,7 @@ class RemoveSettingKeyStoreCommand extends BaseKeyStoreCommand {
private final OptionSpec<String> arguments; private final OptionSpec<String> arguments;
RemoveSettingKeyStoreCommand() { RemoveSettingKeyStoreCommand() {
super("Remove a setting from the keystore", true); super("Remove settings from the keystore", true);
arguments = parser.nonOptions("setting names"); arguments = parser.nonOptions("setting names");
} }