summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tzsetup/tzsetup.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1999-02-02 20:26:31 +0000
committerwollman <wollman@FreeBSD.org>1999-02-02 20:26:31 +0000
commit34b4257ca13d1b8ae119ce234d7466a9c7f640bb (patch)
treea955bb3d689f640a109d38ad76aaf74e68cb9ced /usr.sbin/tzsetup/tzsetup.c
parent5969e9da8d91c36f08ea29c0aa788d38fb113b87 (diff)
downloadFreeBSD-src-34b4257ca13d1b8ae119ce234d7466a9c7f640bb.zip
FreeBSD-src-34b4257ca13d1b8ae119ce234d7466a9c7f640bb.tar.gz
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.
Diffstat (limited to 'usr.sbin/tzsetup/tzsetup.c')
-rw-r--r--usr.sbin/tzsetup/tzsetup.c17
1 files changed, 15 insertions, 2 deletions
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 <sys/types.h>
@@ -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;
OpenPOWER on IntegriCloud