blob: b0c6d65d2a028153134d813bf2c4c1be50f39245 [file] [log] [blame]
Erik Andersene49d5ec2000-02-08 19:58:47 +00001/* vi: set sw=4 ts=4: */
Eric Andersen2b69c401999-10-05 22:58:32 +00002/*
3 * Mini clear implementation for busybox
4 *
Eric Andersenc7bda1c2004-03-15 08:29:22 +00005 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Eric Andersen2b69c401999-10-05 22:58:32 +00006 *
"Robert P. J. Day"801ab142006-07-12 07:56:04 +00007 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Eric Andersen2b69c401999-10-05 22:58:32 +00008 *
9 */
10
Eric Andersen7f6295f2003-10-22 10:34:15 +000011/* no options, no getopt */
12
Denis Vlasenkob6adbf12007-05-26 19:00:18 +000013#include "libbb.h"
Eric Andersencc8ed391999-10-05 16:24:54 +000014
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +000015int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000016int clear_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
Eric Andersencc8ed391999-10-05 16:24:54 +000017{
Denys Vlasenkod9a3e892010-05-16 23:42:13 +020018 /* home; clear to the end of screen */
19 return printf("\033[H""\033[J") != 6;
Eric Andersencc8ed391999-10-05 16:24:54 +000020}