[hackers] [slstatus] Remove o-flag as it is redundant || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Tue, 22 May 2018 13:27:42 +0200 (CEST)

commit 57f69e900bf7e3e7c60a720bf09f2134b724c5cc
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Mon May 21 21:31:53 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Tue May 22 13:27:11 2018 +0200

    Remove o-flag as it is redundant
    
    Even if we extend the flag to be an n-flag with a numerical input, we
    already have other Unix-tools to take care of us much more flexibly,
    e.g. with head(1) you can easily get the first 10 outputs with
    
            slstatus -s | head -n 10,
    
    but also e.g. discard the first one and then get the consecutive 10
    outputs.
    
    For the X11-root-window-name, you can limit the runtime with timeout(1)
    or a comparable solution.
    
    This reverts commit fa8b939990ed0648f99b0cbeba4efed807160db3.

diff --git a/slstatus.1 b/slstatus.1
index 9517fab..da1a99a 100644
--- a/slstatus.1
+++ b/slstatus.1
_AT_@ -6,7 +6,7 @@
 .Nd suckless status monitor
 .Sh SYNOPSIS
 .Nm
-.Op Fl so
+.Op Fl s
 .Sh DESCRIPTION
 .Nm
 is a suckless status monitor for window managers that use WM_NAME (e.g. dwm) or
_AT_@ -18,8 +18,6 @@ outputs to WM_NAME.
 .Bl -tag -width Ds
 .It Fl s
 Write to stdout instead of WM_NAME.
-.It Fl o
-Write only once and exit.
 .El
 .Sh CUSTOMIZATION
 .Nm
diff --git a/slstatus.c b/slstatus.c
index 9bd9e81..4f7a2fc 100644
--- a/slstatus.c
+++ b/slstatus.c
_AT_@ -42,7 +42,7 @@ difftimespec(struct timespec *res, struct timespec *a, struct timespec *b)
 static void
 usage(void)
 {
- die("usage: %s [-so]", argv0);
+ die("usage: %s [-s]", argv0);
 }
 
 int
_AT_@ -51,18 +51,15 @@ main(int argc, char *argv[])
         struct sigaction act;
         struct timespec start, current, diff, intspec, wait;
         size_t i, len;
- int sflag, oflag, ret;
+ int sflag, ret;
         char status[MAXLEN];
         const char *res;
 
- sflag = oflag = 0;
+ sflag = 0;
         ARGBEGIN {
                 case 's':
                         sflag = 1;
                         break;
- case 'o':
- oflag = 1;
- break;
                 default:
                         usage();
         } ARGEND
_AT_@ -112,10 +109,6 @@ main(int argc, char *argv[])
                         XFlush(dpy);
                 }
 
- if (oflag) {
- done = 1;
- }
-
                 if (!done) {
                         if (clock_gettime(CLOCK_MONOTONIC, &current) < 0) {
                                 die("clock_gettime:");
Received on Tue May 22 2018 - 13:27:42 CEST

This archive was generated by hypermail 2.3.0 : Tue May 22 2018 - 13:36:29 CEST