2011-05-24 20:39:20 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <libgen.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include "util.h"
|
|
|
|
|
2013-06-14 18:20:47 +00:00
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
|
|
|
eprintf("usage: %s string\n", argv0);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2011-05-24 20:39:20 +00:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
2013-06-14 18:20:47 +00:00
|
|
|
ARGBEGIN {
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
} ARGEND;
|
|
|
|
|
|
|
|
if(argc < 1)
|
|
|
|
usage();
|
2011-05-24 20:39:20 +00:00
|
|
|
|
|
|
|
puts(dirname(argv[optind]));
|
2013-06-14 18:20:47 +00:00
|
|
|
|
|
|
|
return 0;
|
2011-05-24 20:39:20 +00:00
|
|
|
}
|
2013-06-14 18:20:47 +00:00
|
|
|
|