summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/dialog/dialog.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-02-23 22:42:44 +0000
committerache <ache@FreeBSD.org>1995-02-23 22:42:44 +0000
commit53a0d9e088063a53a4fb93f7892634c49846c6d3 (patch)
tree4eb67899cf82067280d1fbe945a23a722c2599c3 /gnu/usr.bin/dialog/dialog.c
parente062767a522d941f0c5c2e0e4f60087cf9247105 (diff)
downloadFreeBSD-src-53a0d9e088063a53a4fb93f7892634c49846c6d3.zip
FreeBSD-src-53a0d9e088063a53a4fb93f7892634c49846c6d3.tar.gz
Implement --hline "line" and --hfile file
Diffstat (limited to 'gnu/usr.bin/dialog/dialog.c')
-rw-r--r--gnu/usr.bin/dialog/dialog.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/gnu/usr.bin/dialog/dialog.c b/gnu/usr.bin/dialog/dialog.c
index 060ad75..3056f1e 100644
--- a/gnu/usr.bin/dialog/dialog.c
+++ b/gnu/usr.bin/dialog/dialog.c
@@ -90,6 +90,7 @@ int main(int argc, unsigned char *argv[])
int offset = 0, clear_screen = 0, end_common_opts = 0, retval;
unsigned char *title = NULL;
unsigned char result[MAX_LEN];
+ char *hline = NULL, *hfile = NULL;
if (argc < 2) {
Usage(argv[0]);
@@ -120,6 +121,28 @@ int main(int argc, unsigned char *argv[])
offset += 2;
}
}
+ else if (!strcmp(argv[offset+1], "--hline")) {
+ if (argc-offset < 3 || hline != NULL) { /* No two "--hline" please! */
+ Usage(argv[0]);
+ exit(-1);
+ }
+ else {
+ hline = argv[offset+2];
+ use_helpline(hline);
+ offset += 2;
+ }
+ }
+ else if (!strcmp(argv[offset+1], "--hfile")) {
+ if (argc-offset < 3 || hfile != NULL) { /* No two "--hfile" please! */
+ Usage(argv[0]);
+ exit(-1);
+ }
+ else {
+ hfile = argv[offset+2];
+ use_helpfile(hfile);
+ offset += 2;
+ }
+ }
else if (!strcmp(argv[offset+1], "--clear")) {
if (clear_screen) { /* Hey, "--clear" can't appear twice! */
Usage(argv[0]);
@@ -325,12 +348,14 @@ void Usage(unsigned char *name)
fprintf(stderr, "\
\ndialog version 0.3, by Savio Lam (lam836@cs.cuhk.hk).\
\n patched to version %s by Stuart Herbert (S.Herbert@shef.ac.uk)\
+\n Changes Copyright (C) 1995 by Andrey A. Chernov, Moscow, Russia\
\n\
\n* Display dialog boxes from shell scripts *\
\n\
\nUsage: %s --clear\
\n %s --create-rc <file>\
-\n %s [--title <title>] [--clear] <Box options>\
+\n %s [--title <title>] [--clear] [--hline <line>] [--hfile <file>]\\\
+\n <Box options>\
\n\
\nBox options:\
\n\
OpenPOWER on IntegriCloud