about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--config.c16
-rw-r--r--pounce.155
2 files changed, 36 insertions, 35 deletions
diff --git a/config.c b/config.c
index 30d7c6c..2310e83 100644
--- a/config.c
+++ b/config.c
@@ -26,7 +26,9 @@
  */
 
 #include <err.h>
+#include <errno.h>
 #include <getopt.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -95,13 +97,6 @@ int getopt_config(
 			}
 
 			char *equal = &name[len] + strspn(&name[len], WS);
-			if (*equal && *equal != '=') {
-				warnx(
-					"%s:%zu: option `%s' missing equals sign",
-					path, num, option->name
-				);
-				return clean('?');
-			}
 			if (option->has_arg == no_argument && *equal) {
 				warnx(
 					"%s:%zu: option `%s' doesn't allow an argument",
@@ -119,8 +114,11 @@ int getopt_config(
 
 			optarg = NULL;
 			if (*equal) {
-				char *arg = &equal[1] + strspn(&equal[1], WS);
-				optarg = strdup(arg);
+				if (*equal == '=') {
+					optarg = strdup(&equal[1] + strspn(&equal[1], WS));
+				} else {
+					optarg = strdup(equal);
+				}
 				if (!optarg) {
 					warn("getopt_config");
 					return clean('?');
diff --git a/pounce.1 b/pounce.1
index 9db8b58..f3e9766 100644
--- a/pounce.1
+++ b/pounce.1
@@ -130,12 +130,15 @@ Each option is placed on a line,
 and lines beginning with
 .Ql #
 are ignored.
+An optional
+.Ql =
+may appear between an option and its value.
 The options are listed below
 following their corresponding flags.
 .
 .Ss Local Server Options
 .Bl -tag -width Ds
-.It Fl A Ar path | Cm local-ca No = Ar path
+.It Fl A Ar path | Cm local-ca Ar path
 Require clients to authenticate
 using a TLS client certificate
 either contained in
@@ -153,7 +156,7 @@ is also set,
 clients may instead authenticate
 with a server password.
 .
-.It Fl C Ar path | Cm local-cert No = Ar path
+.It Fl C Ar path | Cm local-cert Ar path
 Load TLS certificate from
 .Ar path .
 The file is reloaded when the
@@ -166,12 +169,12 @@ where
 is set by
 .Cm local-host .
 .
-.It Fl H Ar host | Cm local-host No = Ar host
+.It Fl H Ar host | Cm local-host Ar host
 Bind to
 .Ar host .
 The default host is localhost.
 .
-.It Fl K Ar path | Cm local-priv No = Ar path
+.It Fl K Ar path | Cm local-priv Ar path
 Load TLS private key from
 .Ar path .
 The file is reloaded when the
@@ -184,7 +187,7 @@ where
 is set by
 .Cm local-host .
 .
-.It Fl P Ar port | Cm local-port No = Ar port
+.It Fl P Ar port | Cm local-port Ar port
 Bind to
 .Ar port .
 The default port is 6697.
@@ -194,7 +197,7 @@ Do not advertise a
 strict transport security (STS) policy
 to clients.
 .
-.It Fl U Ar path | Cm local-path No = Ar path
+.It Fl U Ar path | Cm local-path Ar path
 Bind to a UNIX-domain socket at
 .Ar path .
 Clients are only accepted as dispatched by
@@ -212,7 +215,7 @@ This option takes precedence over
 and
 .Cm local-port .
 .
-.It Fl W Ar pass | Cm local-pass No = Ar pass
+.It Fl W Ar pass | Cm local-pass Ar pass
 Require the server password
 .Ar pass
 for clients to connect.
@@ -226,7 +229,7 @@ is also set,
 clients may instead authenticate
 using a TLS client certificate.
 .
-.It Fl f Ar path | Cm save No = Ar path
+.It Fl f Ar path | Cm save Ar path
 Save and load the contents of the buffer from
 .Ar path
 in
@@ -242,7 +245,7 @@ or
 .Ql \&../ .
 The file is truncated after loading.
 .
-.It Fl s Ar size | Cm size No = Ar size
+.It Fl s Ar size | Cm size Ar size
 Set the number of messages contained in the buffer to
 .Ar size .
 This sets the maximum number
@@ -263,7 +266,7 @@ This avoids already connected clients
 receiving unsolicited responses
 but prevents new clients from populating user lists.
 .
-.It Fl Q Ar ms | Cm queue-interval No = Ar ms
+.It Fl Q Ar ms | Cm queue-interval Ar ms
 Set the server send queue interval in milliseconds.
 The queue is used
 to send automated messages from
@@ -273,7 +276,7 @@ Messages from clients
 are sent to the server directly.
 The default interval is 200 milliseconds.
 .
-.It Fl R Ar caps | Cm blind-req No = Ar caps
+.It Fl R Ar caps | Cm blind-req Ar caps
 Blindly request the IRCv3 capabilities
 .Ar caps ,
 which must be supported by
@@ -283,7 +286,7 @@ such as
 .Sy userhost-in-names
 on some networks.
 .
-.It Fl S Ar host | Cm bind No = Ar host
+.It Fl S Ar host | Cm bind Ar host
 Bind to source address
 .Ar host
 when connecting to the server.
@@ -294,7 +297,7 @@ To connect from any address
 over IPv6 only,
 use ::.
 .
-.It Fl a Ar user : Ns Ar pass | Cm sasl-plain No = Ar user : Ns Ar pass
+.It Fl a Ar user : Ns Ar pass | Cm sasl-plain Ar user : Ns Ar pass
 Authenticate as
 .Ar user
 with
@@ -305,7 +308,7 @@ the account password in plaintext,
 it is recommended to use CertFP instead with
 .Cm sasl-external .
 .
-.It Fl c Ar path | Cm client-cert No = Ar path
+.It Fl c Ar path | Cm client-cert Ar path
 Load the TLS client certificate from
 .Ar path .
 If the private key is in a separate file,
@@ -325,61 +328,61 @@ The TLS client certificate is loaded with
 See
 .Sx Configuring CertFP .
 .
-.It Fl h Ar host | Cm host No = Ar host
+.It Fl h Ar host | Cm host Ar host
 Connect to
 .Ar host .
 .
-.It Fl j Ar channels Oo Ar keys Oc | Cm join No = Ar channels Op Ar keys
+.It Fl j Ar channels Oo Ar keys Oc | Cm join Ar channels Op Ar keys
 Join the comma-separated list of
 .Ar channels
 with the optional comma-separated list of channel
 .Ar keys .
 .
-.It Fl k Ar path | Cm client-priv No = Ar path
+.It Fl k Ar path | Cm client-priv Ar path
 Load the TLS client private key from
 .Ar path .
 .
-.It Fl m Ar mode | Cm mode No = Ar mode
+.It Fl m Ar mode | Cm mode Ar mode
 Set the user
 .Ar mode .
 .
-.It Fl n Ar nick | Cm nick No = Ar nick
+.It Fl n Ar nick | Cm nick Ar nick
 Set nickname to
 .Ar nick .
 The default nickname is the user's name.
 .
-.It Fl p Ar port | Cm port No = Ar port
+.It Fl p Ar port | Cm port Ar port
 Connect to
 .Ar port .
 The default port is 6697.
 .
-.It Fl q Ar mesg | Cm quit No = Ar mesg
+.It Fl q Ar mesg | Cm quit Ar mesg
 Quit with message
 .Ar mesg
 when shutting down.
 .
-.It Fl r Ar real | Cm real No = Ar real
+.It Fl r Ar real | Cm real Ar real
 Set realname to
 .Ar real .
 The default realname is the same as the nickname.
 .
-.It Fl t Ar path | Cm trust No = Ar path
+.It Fl t Ar path | Cm trust Ar path
 Trust the certificate loaded from
 .Ar path .
 Server name verification is disabled.
 See
 .Sx Connecting to Servers with Self-signed Certificates .
 .
-.It Fl u Ar user | Cm user No = Ar user
+.It Fl u Ar user | Cm user Ar user
 Set username to
 .Ar user .
 The default username is the same as the nickname.
 .
-.It Fl w Ar pass | Cm pass No = Ar pass
+.It Fl w Ar pass | Cm pass Ar pass
 Log in with the server password
 .Ar pass .
 .
-.It Fl y Ar mesg | Cm away No = Ar mesg
+.It Fl y Ar mesg | Cm away Ar mesg
 Set away status to
 .Ar mesg
 when no clients are connected