aboutsummaryrefslogtreecommitdiff
path: root/toys/dirname.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/dirname.c')
-rw-r--r--toys/dirname.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/toys/dirname.c b/toys/dirname.c
new file mode 100644
index 00000000..454a5d67
--- /dev/null
+++ b/toys/dirname.c
@@ -0,0 +1,8 @@
+#include "toys.h"
+#include <libgen.h>
+
+int dirname_main(void)
+{
+ puts(dirname(toys.optargs[0]));
+ return 0;
+}