soroban-cli
soroban-cli copied to clipboard
`stellar keys rm` confusing with global keys
trafficstars
What version are you using?
22.6.0
What did you do?
$ stellar keys generate k1 --global
✅ Key saved with alias k1 in "/Users/leighmcculloch/.config/stellar/identity/k1.toml"
$ stellar keys generate k2
✅ Key saved with alias k2 in "/Users/leighmcculloch/CodeScratch/test/.stellar/identity/k2.toml"
$ stellar keys ls
k2
k1
$ stellar keys rm k1
$ stellar keys ls
k2
k1
$ stellar keys rm --global k1
$ stellar keys ls
k2
What did you expect to see?
An error removing k1 if the command was not actually going to remove k1.
Or, removing k1 from any location.
If there was no possibility of k1 sticking around because there was only one key store location, then I think it'd be fine if the rm subcommand didn't error in this case.
But because it's possible to request to remove k1, and k1 can be in multiple places it needs to error if it isn't actually removing the key.
This is really just more evidence for why multiple key locations is confusing.
What did you see instead?
k1 not be removed, key is still there.