From 821604a1075e7f2e75e04dfe9da2c27b2fb0d577 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 7 Jan 2020 17:11:56 -0500 Subject: Rename -A and -Q to -y and -q The other upper-case options are related to the listening side of things, not the server side, so this is more consistent. This is incompatible, but will fail loudly, and I expect these options are more likely set in a configuration file, if they are set at all. I also want to free up -A for setting a client CA, but assuming your away message is not also an existing file path, that will continue to fail loudly. --- bounce.c | 10 +++++----- pounce.1 | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bounce.c b/bounce.c index 2b1413d..89b2ff1 100644 --- a/bounce.c +++ b/bounce.c @@ -232,16 +232,14 @@ int main(int argc, char *argv[]) { const char *join = NULL; const char *quit = "connection reset by purr"; - const char *Opts = "!A:C:H:K:NP:Q:U:W:a:c:ef:g:h:j:k:n:p:r:s:u:vw:x"; + const char *Opts = "!C:H:K:NP:U:W:a:c:ef:g:h:j:k:n:p:q:r:s:u:vw:xy:"; const struct option LongOpts[] = { { "insecure", no_argument, NULL, '!' }, - { "away", required_argument, NULL, 'A' }, { "cert", required_argument, NULL, 'C' }, { "bind-host", required_argument, NULL, 'H' }, { "priv", required_argument, NULL, 'K' }, { "no-names", no_argument, NULL, 'N' }, { "bind-port", required_argument, NULL, 'P' }, - { "quit", required_argument, NULL, 'Q' }, { "bind-path", required_argument, NULL, 'U' }, { "client-pass", required_argument, NULL, 'W' }, { "sasl-plain", required_argument, NULL, 'a' }, @@ -253,11 +251,13 @@ int main(int argc, char *argv[]) { { "client-priv", required_argument, NULL, 'k' }, { "nick", required_argument, NULL, 'n' }, { "port", required_argument, NULL, 'p' }, + { "quit", required_argument, NULL, 'q' }, { "real", required_argument, NULL, 'r' }, { "size", required_argument, NULL, 's' }, { "user", required_argument, NULL, 'u' }, { "verbose", no_argument, NULL, 'v' }, { "pass", required_argument, NULL, 'w' }, + { "away", required_argument, NULL, 'y' }, {0}, }; @@ -265,13 +265,11 @@ int main(int argc, char *argv[]) { while (0 < (opt = getopt_config(argc, argv, Opts, LongOpts, NULL))) { switch (opt) { break; case '!': insecure = true; - break; case 'A': clientAway = optarg; break; case 'C': strlcpy(certPath, optarg, sizeof(certPath)); break; case 'H': bindHost = optarg; break; case 'K': strlcpy(privPath, optarg, sizeof(privPath)); break; case 'N': stateNoNames = true; break; case 'P': bindPort = optarg; - break; case 'Q': quit = optarg; break; case 'U': strlcpy(bindPath, optarg, sizeof(bindPath)); break; case 'W': clientPass = optarg; break; case 'a': sasl = true; plain = optarg; @@ -284,12 +282,14 @@ int main(int argc, char *argv[]) { break; case 'k': clientPriv = optarg; break; case 'n': nick = optarg; break; case 'p': port = optarg; + break; case 'q': quit = optarg; break; case 'r': real = optarg; break; case 's': ringSize = parseSize(optarg); break; case 'u': user = optarg; break; case 'v': verbose = true; break; case 'w': pass = optarg; break; case 'x': hashPass(); return EX_OK; + break; case 'y': clientAway = optarg; break; default: return EX_USAGE; } } diff --git a/pounce.1 b/pounce.1 index eceb714..06ffc94 100644 --- a/pounce.1 +++ b/pounce.1 @@ -1,4 +1,4 @@ -.Dd December 8, 2019 +.Dd January 7, 2020 .Dt POUNCE 1 .Os . @@ -9,12 +9,10 @@ .Sh SYNOPSIS .Nm .Op Fl Nev -.Op Fl A Ar away .Op Fl C Ar cert .Op Fl H Ar host .Op Fl K Ar priv .Op Fl P Ar port -.Op Fl Q Ar quit .Op Fl U Ar unix .Op Fl W Ar pass .Op Fl a Ar auth @@ -25,10 +23,12 @@ .Op Fl k Ar priv .Op Fl n Ar nick .Op Fl p Ar port +.Op Fl q Ar quit .Op Fl r Ar real .Op Fl s Ar size .Op Fl u Ar user .Op Fl w Ar pass +.Op Fl y Ar away .Op Ar config ... . .Nm @@ -68,11 +68,6 @@ following their corresponding flags. The arguments are as follows: . .Bl -tag -width Ds -.It Fl A Ar mesg , Cm away = Ar mesg -Set away status to -.Ar mesg -when no clients are connected. -. .It Fl C Ar path , Cm cert = Ar path Load TLS certificate from .Ar path . @@ -111,11 +106,6 @@ Bind to .Ar port . The default port is 6697. . -.It Fl Q Ar mesg , Cm quit = Ar mesg -Quit with message -.Ar mesg -when shutting down. -. .It Fl U Ar path , Cm bind-path = Ar path Bind to a UNIX-domain socket at .Ar path . @@ -210,6 +200,11 @@ Connect to .Ar port . The default port is 6697. . +.It Fl q Ar mesg , Cm quit = Ar mesg +Quit with message +.Ar mesg +when shutting down. +. .It Fl r Ar real , Cm real = Ar real Set realname to .Ar real . @@ -242,6 +237,11 @@ Prompt for a password and output a hash for use with .Fl W . +. +.It Fl y Ar mesg , Cm away = Ar mesg +Set away status to +.Ar mesg +when no clients are connected. .El . .Pp -- cgit 1.4.1