mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
litcli: default update expirationDate to -1 and make optional
Set expirationDate default to -1, update positional argument usage and prepend "(optional)" to the flag usage string.
This commit is contained in:
parent
ec5f353e12
commit
46c7495e41
1 changed files with 9 additions and 6 deletions
|
|
@ -146,7 +146,7 @@ var updateAccountCommand = cli.Command{
|
|||
Name: "update",
|
||||
ShortName: "u",
|
||||
Usage: "Update an existing off-chain account.",
|
||||
ArgsUsage: "[id | label] new_expiration_date",
|
||||
ArgsUsage: "[id | label] [new_expiration_date]",
|
||||
Description: "Updates an existing off-chain account and sets " +
|
||||
"a new expiration date and optionally a new label.",
|
||||
Flags: []cli.Flag{
|
||||
|
|
@ -167,10 +167,10 @@ var updateAccountCommand = cli.Command{
|
|||
},
|
||||
cli.Int64Flag{
|
||||
Name: "new_expiration_date",
|
||||
Usage: "The new expiration date of the account " +
|
||||
"expressed in seconds since the unix epoch; " +
|
||||
"-1 means do not update the expiration date; " +
|
||||
"0 means it does not expire.",
|
||||
Usage: "(optional) The new expiration date of " +
|
||||
"the account expressed in seconds since the " +
|
||||
"unix epoch; -1 means do not update the " +
|
||||
"expiration date; 0 means it does not expire.",
|
||||
Value: -1,
|
||||
},
|
||||
},
|
||||
|
|
@ -196,7 +196,7 @@ func updateAccount(cli *cli.Context) error {
|
|||
}
|
||||
|
||||
var (
|
||||
expirationDate int64
|
||||
expirationDate int64 = -1
|
||||
)
|
||||
switch {
|
||||
case cli.IsSet("new_expiration_date"):
|
||||
|
|
@ -210,6 +210,9 @@ func updateAccount(cli *cli.Context) error {
|
|||
}
|
||||
args = args.Tail()
|
||||
}
|
||||
if args.Present() {
|
||||
return fmt.Errorf("too many arguments provided")
|
||||
}
|
||||
|
||||
req := &litrpc.UpdateAccountRequest{
|
||||
Id: id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue