Skip to content

Commit d3530b1

Browse files
BarbatosBarbatos
authored andcommitted
docs(plugins): correct keystore CLI option names in README
Two CLI flags in plugins/README.md did not match the actual @option declarations in the picocli command classes — users following the docs verbatim would hit "Unknown option" errors: - `keystore import` was documented with `--private-key-file`, but the actual option in KeystoreImport.java:41 is `--key-file`. Updated the full-command synopsis and the example accordingly, and added the missing `--force` flag (used by the duplicate-address override path). - `keystore update` was documented with a separate `--new-password-file`, but KeystoreUpdate.java only defines a single `--password-file` whose contents are a two-line file (current password, then new password). Removed the bogus flag and added an explicit note next to the synopsis describing the expected file format, plus an updated entry in the Common Options list. No code changes — purely documentation alignment so the README matches the implemented CLI surface.
1 parent 29d7d20 commit d3530b1

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

plugins/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ Import a private key into a new keystore file.
175175

176176
```shell script
177177
# full command
178-
java -jar Toolkit.jar keystore import [-h] [--keystore-dir=<dir>] [--password-file=<file>] [--private-key-file=<file>] [--sm2] [--json]
178+
java -jar Toolkit.jar keystore import [-h] [--keystore-dir=<dir>] [--password-file=<file>] [--key-file=<file>] [--sm2] [--force] [--json]
179179
# examples
180-
java -jar Toolkit.jar keystore import # interactive prompt
181-
java -jar Toolkit.jar keystore import --private-key-file key.txt --json # from file with JSON output
180+
java -jar Toolkit.jar keystore import # interactive prompt
181+
java -jar Toolkit.jar keystore import --key-file key.txt --json # from file with JSON output
182182
```
183183

184184
#### keystore list
@@ -201,16 +201,20 @@ Change the password of a keystore file.
201201

202202
```shell script
203203
# full command
204-
java -jar Toolkit.jar keystore update [-h] <address> [--keystore-dir=<dir>] [--password-file=<file>] [--new-password-file=<file>] [--json]
204+
java -jar Toolkit.jar keystore update [-h] <address> [--keystore-dir=<dir>] [--password-file=<file>] [--sm2] [--json]
205205
# examples
206206
java -jar Toolkit.jar keystore update TXyz...abc # interactive prompt
207207
java -jar Toolkit.jar keystore update TXyz...abc --keystore-dir /data/ks # custom directory
208208
```
209209

210+
When using `--password-file` with `update`, the file must contain exactly two lines: the **current** password on the first line and the **new** password on the second line. Both leading/trailing whitespace within a line is preserved (passphrases with spaces are supported).
211+
210212
### Common Options
211213

212214
- `--keystore-dir`: Keystore directory, default: `./Wallet`.
213-
- `--password-file`: Read password from a file instead of interactive prompt.
215+
- `--password-file`: Read password from a file instead of interactive prompt. For `keystore update`, the file must contain exactly two lines (current password, then new password).
216+
- `--key-file`: Read the private key (hex, with or without `0x` prefix) from a file instead of the interactive prompt (`keystore import` only).
217+
- `--force`: For `keystore import`, allow importing a private key whose address already has a keystore in the directory (creates an additional file).
214218
- `--sm2`: Use SM2 algorithm instead of ECDSA (for `new` and `import`).
215219
- `--json`: Output in JSON format for scripting.
216220
- `-h | --help`: Provide the help info.

0 commit comments

Comments
 (0)