From 34b4257ca13d1b8ae119ce234d7466a9c7f640bb Mon Sep 17 00:00:00 2001 From: wollman Date: Tue, 2 Feb 1999 20:26:31 +0000 Subject: Add a `default' feature to tzsetup for use in script-driven installation (if someone writes the other half). Also rewrite the man page in a more appropriate (formal) style. --- usr.sbin/tzsetup/tzsetup.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'usr.sbin/tzsetup/tzsetup.c') diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 42522b6..70b91a5 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tzsetup.c,v 1.10 1998/01/10 15:55:11 steve Exp $"; + "$Id: tzsetup.c,v 1.11 1998/12/16 05:34:49 peter Exp $"; #endif /* not lint */ #include @@ -644,7 +644,7 @@ main(int argc, char **argv) } } - if (optind != argc) + if (argc - optind > 1) usage(); read_iso3166_table(); @@ -668,8 +668,21 @@ main(int argc, char **argv) } } dialog_clear_norefresh(); + if (optind == argc - 1) { + char *msg; + asprintf(&msg, "\nUse the default `%s' zone?", argv[optind]); + if (!dialog_yesno("Default timezone provided", msg, 7, 72)) { + install_zone_file(argv[optind]); + dialog_clear(); + end_dialog(); + return 0; + } + free(msg); + dialog_clear_norefresh(); + } dialog_menu("Time Zone Selector", "Select a region", -1, -1, NCONTINENTS, -NCONTINENTS, continents, 0, NULL, NULL); + dialog_clear(); end_dialog(); return 0; -- cgit v1.1