1 /* dirname.c - show directory portion of path
2  *
3  * Copyright 2011 Rob Landley <rob@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 
dirname_main(void)20 void dirname_main(void)
21 {
22   puts(dirname(*toys.optargs));
23 }
24