Make CLI commands use positional arguments#123
Make CLI commands use positional arguments#123benthecarman wants to merge 1 commit intolightningdevkit:mainfrom
Conversation
Made it so the primary arguments in our cli commands no longer use named flags but instead use positional arguments. For example, bolt11-send can now be used as `bolt11-send <invoice>` instead of `bolt11-send --invoice <invoice>`.
|
I've assigned @jkczyz as a reviewer! |
|
🔔 1st Reminder Hey @jkczyz! This PR has been waiting for your review. |
| #[arg(help = "The address to send coins to")] | ||
| address: String, | ||
| #[arg( | ||
| long, | ||
| help = "The amount in satoshis to send. Will respect any on-chain reserve needed for anchor channels" | ||
| )] | ||
| amount_sats: Option<u64>, |
There was a problem hiding this comment.
Small concern with using positional arguments where the named argument includes a unit (e.g., sats and msats for amounts). At least when reading code, having u64 for sat and msat parameters can be a source of confusion (e.g., channel open in sats with push msats).
@tnull Any preference?
There was a problem hiding this comment.
hmm yeah, this one will be in sats but the lightning ones are in msats.
We could make the lightning ones in sats as that's what people probably expect more and add a msats option for people who need it.
Made it so the primary arguments in our cli commands no longer use named flags but instead use positional arguments. For example, bolt11-send can now be used as
bolt11-send <invoice>instead ofbolt11-send --invoice <invoice>.