Better usage function

This commit is contained in:
Pierre Pronchery 2004-02-29 04:35:58 +00:00
parent f457f2ab9e
commit 410285ceb1
2 changed files with 9 additions and 10 deletions

View File

@ -1,9 +1,3 @@
basename:
- separate usage()
dirname:
- separate usage()
id:
- write more readable code
- check if it's complete

View File

@ -6,15 +6,20 @@
#include <stdio.h>
/* usage */
static int usage(void)
{
fprintf(stderr, "%s", "Usage: dirname string\n");
return 1;
}
/* main */
int main(int argc, char * argv[])
{
/* check for errors */
if(argc != 2)
{
fprintf(stderr, "%s", "Usage: dirname string\n");
return 1;
}
return usage();
/* dirname */
printf("%s\n", dirname(argv[1]));
return 0;