mirror of git://git.suckless.org/ubase
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
|
.Nm
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
clears the screen
|
clears the screen.
|
||||||
|
|
18
clear.c
18
clear.c
|
@ -2,9 +2,23 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int
|
#include "util.h"
|
||||||
main(void)
|
|
||||||
|
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");
|
printf("\x1b[2J\x1b[H");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue