Commit 83e42a08 authored by Youness Alaoui's avatar Youness Alaoui
Browse files

Add support for --clear argument

parent 6d9fe46c
...@@ -185,9 +185,7 @@ void print_usage (int exit_code) ...@@ -185,9 +185,7 @@ void print_usage (int exit_code)
{ {
printf ("Box options: \n"); printf ("Box options: \n");
printf ("\t--msgbox <text> <height> <width>\n"); printf ("\t--msgbox <text> <height> <width>\n");
printf ("\t\tThis option is not yet supported\n");
printf ("\t--yesno <text> <height> <width>\n"); printf ("\t--yesno <text> <height> <width>\n");
printf ("\t\tThis option is not yet supported\n");
printf ("\t--infobox <text> <height> <width>\n"); printf ("\t--infobox <text> <height> <width>\n");
printf ("\t\tThis option is not supported\n"); printf ("\t\tThis option is not supported\n");
printf ("\t--inputbox <text> <height> <width> [init] \n"); printf ("\t--inputbox <text> <height> <width> [init] \n");
...@@ -205,7 +203,6 @@ void print_usage (int exit_code) ...@@ -205,7 +203,6 @@ void print_usage (int exit_code)
printf ("\t\tThis option is not supported\n"); printf ("\t\tThis option is not supported\n");
printf ("Options: (depend on box-option)\n"); printf ("Options: (depend on box-option)\n");
printf ("\t--clear\t\t\t\tclear screen on exit\n"); printf ("\t--clear\t\t\t\tclear screen on exit\n");
printf ("\t\tThis option is not supported\n");
printf ("\t--defaultno\t\t\tdefault no button\n"); printf ("\t--defaultno\t\t\tdefault no button\n");
printf ("\t--default-item <string>\t\tset default string\n"); printf ("\t--default-item <string>\t\tset default string\n");
printf ("\t--fb, --fullbuttons\t\tuse full buttons\n"); printf ("\t--fb, --fullbuttons\t\tuse full buttons\n");
...@@ -287,6 +284,8 @@ int parse_whiptail_args (int argc, char **argv, whiptail_args *args) ...@@ -287,6 +284,8 @@ int parse_whiptail_args (int argc, char **argv, whiptail_args *args)
args->notags = 1; args->notags = 1;
} else if (strcmp (argv[i], "--topleft") == 0) { } else if (strcmp (argv[i], "--topleft") == 0) {
args->topleft = 1; args->topleft = 1;
} else if (strcmp (argv[i], "--clear") == 0) {
args->clear = 1;
} else if (strcmp (argv[i], "--menu") == 0) { } else if (strcmp (argv[i], "--menu") == 0) {
if (args->mode != MODE_NONE) if (args->mode != MODE_NONE)
goto mode_already_set; goto mode_already_set;
...@@ -337,8 +336,7 @@ int parse_whiptail_args (int argc, char **argv, whiptail_args *args) ...@@ -337,8 +336,7 @@ int parse_whiptail_args (int argc, char **argv, whiptail_args *args)
if (i + 1 >= argc) if (i + 1 >= argc)
goto missing_value; goto missing_value;
args->cancel_button = argv[++i]; args->cancel_button = argv[++i];
} else if (strcmp (argv[i], "--clear") == 0 || } else if (strcmp (argv[i], "--fb") == 0 ||
strcmp (argv[i], "--fb") == 0 ||
strcmp (argv[i], "--fullbuttons") == 0 || strcmp (argv[i], "--fullbuttons") == 0 ||
strcmp (argv[i], "--defaultno") == 0 || strcmp (argv[i], "--defaultno") == 0 ||
strcmp (argv[i], "--nocancel") == 0 || strcmp (argv[i], "--nocancel") == 0 ||
...@@ -422,6 +420,8 @@ int main(int argc, char **argv) ...@@ -422,6 +420,8 @@ int main(int argc, char **argv)
return -1; return -1;
} }
if (args.clear)
printf ("\033c");
#ifdef GTKWHIPTAIL #ifdef GTKWHIPTAIL
gtk_init(&argc, &argv); gtk_init(&argc, &argv);
......
...@@ -68,6 +68,7 @@ typedef struct { ...@@ -68,6 +68,7 @@ typedef struct {
char *no_button; char *no_button;
char *ok_button; char *ok_button;
char *cancel_button; char *cancel_button;
int clear;
int noitem; int noitem;
int notags; int notags;
int topleft; int topleft;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment