Cleanup command line options for notify kitten

This commit is contained in:
Kovid Goyal 2024-08-01 06:44:15 +05:30
parent 6a203487a9
commit 34484ef854
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 13 additions and 12 deletions

View file

@ -305,8 +305,8 @@ func main(_ *cli.Command, opts *Options, args []string) (rc int, err error) {
term.RestoreAndClose()
}
}
if p.expire_time, err = parse_duration(opts.ExpireTime); err != nil {
return 1, fmt.Errorf("Invalid expire time: %s with error: %w", opts.ExpireTime, err)
if p.expire_time, err = parse_duration(opts.ExpireAfter); err != nil {
return 1, fmt.Errorf("Invalid expire time: %s with error: %w", opts.ExpireAfter, err)
}
p.wait_till_closed = opts.WaitTillClosed
if err = p.load_image_data(); err != nil {

View file

@ -7,7 +7,7 @@
def OPTIONS() -> str:
from kitty.constants import standard_icon_names
return f'''
--icon -i
--icon -n
type=list
The name of the icon to use for the notification. An icon with this name
will be searched for on the computer running the terminal emulator. Can
@ -15,7 +15,7 @@ def OPTIONS() -> str:
Standard names: {', '.join(sorted(standard_icon_names))}
--icon-path -I
--icon-path -p
Path to an image file in PNG/JPEG/GIF formats to use as the icon. If both
name and path are specified then first the name will be looked for and if not found
then the path will be used.
@ -29,7 +29,7 @@ def OPTIONS() -> str:
--button -b
type=list
Add a button with the specified text to the notification. Can be specified multiple times for multiple buttons.
If --wait-for-completion is used then the kitten will print th ebutton number to STDOUT if the user clicks a button.
If --wait-till-closed is used then the kitten will print the button number to STDOUT if the user clicks a button.
1 for the first button, 2 for the second button and so on.
@ -39,7 +39,7 @@ def OPTIONS() -> str:
The urgency of the notification.
--expire-time -t
--expire-after -e
The duration, for the notification to appear on screen. The default is to
use the policy of the OS notification service. A value of :code:`never` means the notification should
never expire, however, this may or may not work depending on the policies of the OS notification
@ -50,26 +50,27 @@ def OPTIONS() -> str:
action or OS policy.
--type -c
--type -t
The notification type. Can be any string, it is used by users to create filter rules
for notifications, so choose something descriptive of the notifications, purpose.
for notifications, so choose something descriptive of the notification's purpose.
--identifier
--identifier -i
The identifier of this notification. If a notification with the same identifier
is already displayed, it is replaced/updated.
--print-identifier -p
--print-identifier -P
type=bool-set
Print the identifier for the notification to STDOUT. Useful when not specifying
your own identifier via the --identifier option.
--wait-till-closed -w
--wait-till-closed --wait-for-completion -w
type=bool-set
Wait until the notification is closed. If the user activates the notification,
"0" is printed to STDOUT before quitting. Press the Esc or Ctrl+C keys
"0" is printed to STDOUT before quitting. If a button on the notification is pressed the
number corresponding to the button is printed to STDOUT. Press the Esc or Ctrl+C keys
to close the notification manually.