aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-02-06 13:18:46 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-02-11 10:22:53 -0500
commita2f661dceb5baa20bd5d329fbb6fb2d75a4a09f8 (patch)
tree58168d2c3e464d556b1be8d76208f4f82258eabc
parentipc_has_event_listeners: fix inverted check of subscribed_events (diff)
downloadsway-a2f661dceb5baa20bd5d329fbb6fb2d75a4a09f8.tar.gz
sway-a2f661dceb5baa20bd5d329fbb6fb2d75a4a09f8.tar.zst
sway-a2f661dceb5baa20bd5d329fbb6fb2d75a4a09f8.zip
Clarify error for options and positional args
When both options and positional arguments are given, sway would print the error `Don't use options with the IPC client`. Over the past several months, it seems like users are including this error message in issues instead of a debug log due to not understanding that the error message means there is an issue with their command. This makes the error message more verbose and will hopefully make it so more users understand that the message is not a bug in sway, but with the command used.
-rw-r--r--sway/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sway/main.c b/sway/main.c
index 67d0f799..12f92bd8 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -320,7 +320,13 @@ int main(int argc, char **argv) {
320 320
321 if (optind < argc) { // Behave as IPC client 321 if (optind < argc) { // Behave as IPC client
322 if (optind != 1) { 322 if (optind != 1) {
323 sway_log(SWAY_ERROR, "Don't use options with the IPC client"); 323 sway_log(SWAY_ERROR,
324 "Detected both options and positional arguments. If you "
325 "are trying to use the IPC client, options are not "
326 "supported. Otherwise, check the provided arguments for "
327 "issues. See `man 1 sway` or `sway -h` for usage. If you "
328 "are trying to generate a debug log, use "
329 "`sway -d 2>sway.log`.");
324 exit(EXIT_FAILURE); 330 exit(EXIT_FAILURE);
325 } 331 }
326 if (!drop_permissions()) { 332 if (!drop_permissions()) {