summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-07 10:22:42 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-04-15 15:42:27 +0800
commitdbf139003bd6c8c6ca03ae7f533aa74afd8060c6 (patch)
tree7613e9e0eeb314aadbef3aa341643db8c360c8f1 /ui/ncurses
parentc62667e5c78ea212e5ac49244e9792954a1d8f71 (diff)
downloadtalos-petitboot-dbf139003bd6c8c6ca03ae7f533aa74afd8060c6.tar.gz
talos-petitboot-dbf139003bd6c8c6ca03ae7f533aa74afd8060c6.zip
Move --dry-run option to discover server
Now that the server does the booting, we should move the --dry-run argument to the server. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses')
-rw-r--r--ui/ncurses/generic-main.c12
-rw-r--r--ui/ncurses/nc-cui.c3
-rw-r--r--ui/ncurses/nc-cui.h3
3 files changed, 5 insertions, 13 deletions
diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c
index ddf0de3..5d8debb 100644
--- a/ui/ncurses/generic-main.c
+++ b/ui/ncurses/generic-main.c
@@ -45,7 +45,7 @@ static void print_usage(void)
{
print_version();
printf(
-"Usage: petitboot-nc [-d, --dry-run] [-h, --help] [-l, --log log-file]\n"
+"Usage: petitboot-nc [-h, --help] [-l, --log log-file]\n"
" [-s, --start-daemon] [-V, --version]\n");
}
@@ -60,7 +60,6 @@ enum opt_value {opt_undef = 0, opt_yes, opt_no};
*/
struct opts {
- enum opt_value dry_run;
enum opt_value show_help;
const char *log_file;
enum opt_value start_daemon;
@@ -74,7 +73,6 @@ struct opts {
static int opts_parse(struct opts *opts, int argc, char *argv[])
{
static const struct option long_options[] = {
- {"dry-run", no_argument, NULL, 'd'},
{"help", no_argument, NULL, 'h'},
{"log", required_argument, NULL, 'l'},
{"start-daemon", no_argument, NULL, 's'},
@@ -96,9 +94,6 @@ static int opts_parse(struct opts *opts, int argc, char *argv[])
break;
switch (c) {
- case 'd':
- opts->dry_run = opt_yes;
- break;
case 'h':
opts->show_help = opt_yes;
break;
@@ -151,8 +146,7 @@ static struct pmenu *pb_mm_init(struct pb_cui *pb_cui)
m->on_open = cui_on_open;
m->scr.frame.title = talloc_asprintf(m,
- "Petitboot (" PACKAGE_VERSION ")%s",
- (pb_cui->cui->dry_run ? " (dry-run)" : ""));
+ "Petitboot (" PACKAGE_VERSION ")");
m->scr.frame.help = talloc_strdup(m,
"ESC=exit, Enter=accept, e=edit, o=open");
m->scr.frame.status = talloc_strdup(m, "Welcome to Petitboot");
@@ -260,7 +254,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
- pb.cui = cui_init(&pb, NULL, opts.start_daemon, opts.dry_run);
+ pb.cui = cui_init(&pb, NULL, opts.start_daemon);
if (!pb.cui)
return EXIT_FAILURE;
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c
index fafa293..37ba1c4 100644
--- a/ui/ncurses/nc-cui.c
+++ b/ui/ncurses/nc-cui.c
@@ -520,7 +520,7 @@ static struct discover_client_ops cui_client_ops = {
*/
struct cui *cui_init(void* platform_info,
- int (*js_map)(const struct js_event *e), int start_deamon, int dry_run)
+ int (*js_map)(const struct js_event *e), int start_deamon)
{
struct cui *cui;
unsigned int i;
@@ -536,7 +536,6 @@ struct cui *cui_init(void* platform_info,
cui->c_sig = pb_cui_sig;
cui->platform_info = platform_info;
cui->timer.handle_timeout = cui_handle_timeout;
- cui->dry_run = dry_run;
cui->waitset = waitset_create(cui);
/* Loop here for scripts that just started the server. */
diff --git a/ui/ncurses/nc-cui.h b/ui/ncurses/nc-cui.h
index 33f2661..69c15d4 100644
--- a/ui/ncurses/nc-cui.h
+++ b/ui/ncurses/nc-cui.h
@@ -51,7 +51,6 @@ struct cui {
enum pb_nc_sig c_sig;
sig_atomic_t abort;
sig_atomic_t resize;
- int dry_run;
struct nc_scr *current;
struct pmenu *main;
struct ui_timer timer;
@@ -64,7 +63,7 @@ struct cui {
};
struct cui *cui_init(void* platform_info,
- int (*js_map)(const struct js_event *e), int start_deamon, int dry_run);
+ int (*js_map)(const struct js_event *e), int start_deamon);
struct nc_scr *cui_set_current(struct cui *cui, struct nc_scr *scr);
int cui_run(struct cui *cui, struct pmenu *main, unsigned int default_item);
int cui_boot_editor_run(struct pmenu_item *item);
OpenPOWER on IntegriCloud