Refactor clear(1)
Adopting best practices(tm) we developed with sbase.
This commit is contained in:
parent
b6669b5f19
commit
7b27c7f87c
2
clear.1
2
clear.1
@ -8,4 +8,4 @@
|
||||
.Nm
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
clears the screen
|
||||
clears the screen.
|
||||
|
18
clear.c
18
clear.c
@ -2,9 +2,23 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
#include "util.h"
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
eprintf("usage: %s\n", argv0);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
argv0 = argv[0], argc--, argv++;
|
||||
|
||||
if (argc)
|
||||
usage();
|
||||
|
||||
printf("\x1b[2J\x1b[H");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user