Home | History | Annotate | Download | only in posix
      1 /* dirname.c - show directory portion of path
      2  *
      3  * Copyright 2011 Rob Landley <rob (at) landley.net>
      4  *
      5  * See http://opengroup.org/onlinepubs/9699919799/utilities/dirname.html
      6 
      7 USE_DIRNAME(NEWTOY(dirname, "<1", TOYFLAG_USR|TOYFLAG_BIN))
      8 
      9 config DIRNAME
     10   bool "dirname"
     11   default y
     12   help
     13     usage: dirname PATH
     14 
     15     Show directory portion of path.
     16 */
     17 
     18 #include "toys.h"
     19 
     20 void dirname_main(void)
     21 {
     22   puts(dirname(*toys.optargs));
     23 }
     24