]> git.lizzy.rs Git - bspwm.git/commitdiff
Prevent invalid use of query's --names option
authorBastien Dejean <nihilhill@gmail.com>
Tue, 25 Jul 2017 18:45:18 +0000 (20:45 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 25 Jul 2017 18:45:18 +0000 (20:45 +0200)
doc/bspwm.1
doc/bspwm.1.asciidoc
src/messages.c

index b1a69a5a8809c0513b0ccc7961538e5e77c33398..bb645bc2a51e94e35efabd2bc173a2f99eaa5730 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 07/24/2017
+.\"      Date: 07/25/2017
 .\"    Manual: Bspwm Manual
-.\"    Source: Bspwm 0.9.3-10-g9ea4b01
+.\"    Source: Bspwm 0.9.3-14-gefec936
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "07/24/2017" "Bspwm 0\&.9\&.3\-10\-g9ea4b01" "Bspwm Manual"
+.TH "BSPWM" "1" "07/25/2017" "Bspwm 0\&.9\&.3\-14\-gefec936" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -858,7 +858,10 @@ and
 .PP
 \fB\-\-names\fR
 .RS 4
-Print names instead of IDs\&.
+Print names instead of IDs\&. Can only be used with
+\fI\-M\fR
+and
+\fI\-D\fR\&.
 .RE
 .RE
 .SS "Wm"
index 5286b10d6990d93563075c7c4ed4ba313b2bcd52..bcf05ff1e71fca37137afd99fffa92bceba8a49e 100644 (file)
@@ -509,7 +509,7 @@ Options
        Constrain matches to the selected monitor, desktop or node. The descriptor can be omitted for '-M', '-D' and '-N'.
 
 *--names*::
-       Print names instead of IDs.
+       Print names instead of IDs. Can only be used with '-M' and '-D'.
 
 Wm
 ~~
index 0994ad36816d7e440d41ed83d37303636353025f..43fc94d94db5d7af8e08846495c760ebb3683b60 100644 (file)
@@ -1053,6 +1053,11 @@ void cmd_query(char **args, int num, FILE *rsp)
                goto end;
        }
 
+       if (!print_ids && (dom == DOMAIN_NODE | dom == DOMAIN_TREE)) {
+               fail(rsp, "query -%c: --names only applies to -M and -D.\n", dom == DOMAIN_NODE ? 'N' : 'T');
+               goto end;
+       }
+
        if (dom == DOMAIN_NODE) {
                if (query_node_ids(&ref, &trg, node_sel, rsp) < 1) {
                        fail(rsp, "");