comparison toys/dirname.c @ 387:67b0ded3c56c

Add dirname, and typo fixes to wc header.
author Rob Landley <rob@landley.net>
date Fri, 18 Nov 2011 06:21:29 -0600
parents
children 31215cc6c9f2
comparison
equal deleted inserted replaced
386:03bf7c545b6f 387:67b0ded3c56c
1 /* vi: set sw=4 ts=4:
2 *
3 * dirname.c - show directory portion of path
4 *
5 * Copyright 2011 Rob Landley <rob@landley.net>
6 *
7 * See http://opengroup.org/onlinepubs/9699919799/utilities/dirname.html
8
9 USE_DIRNAME(NEWTOY(dirname, "<1", TOYFLAG_USR|TOYFLAG_BIN))
10
11 config DIRNAME
12 bool "dirname"
13 default y
14 help
15 usage: dirname PATH
16
17 Show directory portion of path.
18 */
19
20 #include "toys.h"
21 #include <libgen.h>
22
23 void dirname_main(void)
24 {
25 puts(dirname(*toys.optargs));
26 }