diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-05-20 14:14:49 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-05-20 14:14:49 +0200 |
commit | 7b541d0a6d196499712f4e7c9854aa294ac16167 (patch) | |
tree | 3f87ef6e933d4a6df49c0fd4e8a319618ef46444 /src/command/cmd_defs.c | |
parent | 21cc53bdfdb70bc375bf6b4c46593889b9702489 (diff) | |
download | profani-tty-7b541d0a6d196499712f4e7c9854aa294ac16167.tar.gz |
Add /executable command
This is used to set the openers for various commands. So far for /avatar and /urlopen.
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r-- | src/command/cmd_defs.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 398badc0..3cf019b5 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2340,26 +2340,23 @@ static struct cmd_t command_defs[] = }, { "/avatar", - parse_args, 2, 2, &cons_avatar_setting, + parse_args, 2, 2, NULL, CMD_NOSUBFUNCS CMD_MAINFUNC(cmd_avatar) CMD_TAGS( CMD_TAG_CHAT) CMD_SYN( "/avatar get <barejid>", - "/avatar open <barejid>", - "/avatar cmd <command>") + "/avatar open <barejid>") CMD_DESC( "Download avatar (XEP-0084) for a certain contact. " "If nothing happens after using this command the user either doesn't have an avatar set at all " "or doesn't use XEP-0084 to publish it.") CMD_ARGS( { "get <barejid>", "Download the avatar. barejid is the JID to download avatar from."}, - { "cmd <command>", "Set a command to execute with 'avatar open'. Use your favourite image viewer here."}, { "open <barejid>", "Download avatar and open it with command."}) CMD_EXAMPLES( "/avatar get thor@valhalla.edda", - "/avatar cmd xdg-open", "/avatar open freyja@vanaheimr.edda") }, @@ -2466,6 +2463,26 @@ static struct cmd_t command_defs[] = { "<url>", "URL to open."}) CMD_NOEXAMPLES }, + + { "/executable", + parse_args, 2, 2, &cons_executable_setting, + CMD_NOSUBFUNCS + CMD_MAINFUNC(cmd_executable) + CMD_TAGS( + CMD_TAG_DISCOVERY) + CMD_SYN( + "/executable avatar <cmd>", + "/executable urlopen <cmd>") + CMD_DESC( + "Configure executable that should be called upon a certain command." + "Default is xdg-open.") + CMD_ARGS( + { "avatar", "Set executable that is run in /avatar open. Use your favourite image viewer." }, + { "urlopen", "Set executable that is run in /urlopen. Use your favourite browser." }) + CMD_EXAMPLES( + "/executable avatar xdg-open", + "/executable urlopen firefox") + }, }; static GHashTable *search_index; |