]> git.armaanb.net Git - dmenu.git/commitdiff
simpler lsx
authorConnor Lane Smith <cls@lubutu.com>
Sat, 18 Jun 2011 06:50:46 +0000 (07:50 +0100)
committerConnor Lane Smith <cls@lubutu.com>
Sat, 18 Jun 2011 06:50:46 +0000 (07:50 +0100)
dmenu.1
lsx.1
lsx.c

diff --git a/dmenu.1 b/dmenu.1
index 44c953b402111e755a80a1b8d5737bc0f4b23a73..616a2a50c71001433b795e55dc5c9159fcf9a278 100644 (file)
--- a/dmenu.1
+++ b/dmenu.1
@@ -95,4 +95,5 @@ Exit without selecting an item, returning failure.
 .B Ctrl\-y
 Paste the current X selection into the input field.
 .SH SEE ALSO
-.IR dwm (1)
+.IR dwm (1),
+.IR lsx (1)
diff --git a/lsx.1 b/lsx.1
index fbb84ea35f5a89c45c8928100c9154aad6f7d66e..1b2a15e7c12e3785e0de8d64bd04c336bc05d936 100644 (file)
--- a/lsx.1
+++ b/lsx.1
@@ -3,13 +3,9 @@
 lsx \- list executables
 .SH SYNOPSIS
 .B lsx
-.RB [ \-v ]
 .RI [ directory ...]
 .SH DESCRIPTION
 .B lsx
-lists the executables in each directory. If no directories are given the current
-working directory is used.
-.SH OPTIONS
-.TP
-.B \-v
-prints version information to stdout, then exits.
+lists the executables in each
+.IR directory .
+If none are given the current working directory is used.
diff --git a/lsx.c b/lsx.c
index 325c50855a6e626ddc99f01f385606f405e00ae6..fd286258d0433dbbe2c203be4859ed4e74facd2b 100644 (file)
--- a/lsx.c
+++ b/lsx.c
@@ -14,8 +14,6 @@ main(int argc, char *argv[]) {
 
        if(argc < 2)
                lsx(".");
-       else if(!strcmp(argv[1], "-v"))
-               puts("lsx-0.2, © 2006-2011 dmenu engineers, see LICENSE for details");
        else for(i = 1; i < argc; i++)
                lsx(argv[i]);
        return EXIT_SUCCESS;
@@ -34,7 +32,7 @@ lsx(const char *dir) {
        }
        while((d = readdir(dp))) {
                snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name);
-               if(stat(buf, &st) == 0 && S_ISREG(st.st_mode) && access(buf, X_OK) == 0)
+               if(!stat(buf, &st) && S_ISREG(st.st_mode) && access(buf, X_OK) == 0)
                        puts(d->d_name);
        }
        closedir(dp);