aboutsummaryrefslogtreecommitdiff
path: root/AnyEvent-I3
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2017-09-17 15:25:00 +0200
committerGitHub <noreply@github.com>2017-09-17 15:25:00 +0200
commit607e97e65190d1997048b510d72d30ebff1ca129 (patch)
tree39bfcb1e700172edf286c88f2f694b18b384c172 /AnyEvent-I3
parentd726d09d496577d1c337a4b97486f2c9fbc914f1 (diff)
downloadi3-607e97e65190d1997048b510d72d30ebff1ca129.tar.gz
i3-607e97e65190d1997048b510d72d30ebff1ca129.zip
ipc: rename COMMAND to RUN_COMMAND for consistency (#2956)
All other message types are verbs, only our first-ever message COMMAND wasn’t. While we’re here, also change the message type dictionary into a table with clickable links to the corresponding reply type. Authors of downstream IPC libraries are encouraged to keep the old name around so as to not break existing code, but mark it as deprecated.
Diffstat (limited to 'AnyEvent-I3')
-rw-r--r--AnyEvent-I3/lib/AnyEvent/I3.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/AnyEvent-I3/lib/AnyEvent/I3.pm b/AnyEvent-I3/lib/AnyEvent/I3.pm
index 8598f850..6850b267 100644
--- a/AnyEvent-I3/lib/AnyEvent/I3.pm
+++ b/AnyEvent-I3/lib/AnyEvent/I3.pm
@@ -88,6 +88,7 @@ use base 'Exporter';
our @EXPORT = qw(i3);
+use constant TYPE_RUN_COMMAND => 0;
use constant TYPE_COMMAND => 0;
use constant TYPE_GET_WORKSPACES => 1;
use constant TYPE_SUBSCRIBE => 2;
@@ -100,7 +101,7 @@ use constant TYPE_GET_BINDING_MODES => 8;
use constant TYPE_GET_CONFIG => 9;
our %EXPORT_TAGS = ( 'all' => [
- qw(i3 TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS
+ qw(i3 TYPE_RUN_COMMAND TYPE_COMMAND TYPE_GET_WORKSPACES TYPE_SUBSCRIBE TYPE_GET_OUTPUTS
TYPE_GET_TREE TYPE_GET_MARKS TYPE_GET_BAR_CONFIG TYPE_GET_VERSION
TYPE_GET_BINDING_MODES TYPE_GET_CONFIG)
] );
@@ -322,7 +323,7 @@ Sends a message of the specified C<type> to i3, possibly containing the data
structure C<content> (or C<content>, encoded as utf8, if C<content> is a
scalar), if specified.
- my $reply = $i3->message(TYPE_COMMAND, "reload")->recv;
+ my $reply = $i3->message(TYPE_RUN_COMMAND, "reload")->recv;
if ($reply->{success}) {
say "Configuration successfully reloaded";
}
@@ -532,7 +533,7 @@ sub command {
$self->_ensure_connection;
- $self->message(TYPE_COMMAND, $content)
+ $self->message(TYPE_RUN_COMMAND, $content)
}
=head1 AUTHOR