isamert / scli

a simple terminal user interface for signal messenger (using signal-cli)
GNU General Public License v3.0
432 stars 40 forks source link

scli complains about missing placeholder in notification-command #184

Closed Jehops closed 2 years ago

Jehops commented 2 years ago

With notification-command=flite 'scli from %s' in sclirc, the notification is not made and errors like below are reported.

Command string `flite 'scli from John Smith'` should contain a replacement placeholder `%a` (e.g. `some-cmd "%a"`). See `--help`.

It seems the placeholder is correctly being replaced, but scli has something like an off-by-one problem keeping track of the number of placeholders that have been replaced. If I comment out these lines, the notifications are reported as expected.

if key not in cmd and key not in optionals:
    raise ValueError(f'Command string `{cmd}` should contain a replacement placeholder `{key}` (e.g. `some-cmd "{key}"`). See `--help`.')
exquo commented 2 years ago

Thanks for reporting! The %a placeholder (for avatar) should have been optional. Should be fixed now.