summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-08-11 21:37:55 +0200
committerPali Rohár <pali.rohar@gmail.com>2012-08-11 21:37:55 +0200
commit2544d42ee2ebdcd46404339792b7cc9b7c1f5330 (patch)
tree28d7a0f17035017713720a164cbc28097ae7b5f0 /src/main.c
parent0d1d64bbfed4dd12fde3127885c3ab02b1d1331b (diff)
download0xFFFF-2544d42ee2ebdcd46404339792b7cc9b7c1f5330.tar.bz2
main: Check if some action was specified
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index d4f0dd3..bcea89a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -320,6 +320,7 @@ int main(int argc, char **argv) {
int c;
int ret = 0;
+ int do_something = 0;
#if defined(WITH_USB) && ! defined(WITH_DEVICE)
int dev_boot = 0;
@@ -599,6 +600,39 @@ int main(int argc, char **argv) {
goto clean;
}
+#if defined(WITH_USB) && ! defined(WITH_DEVICE)
+ if ( dev_boot || dev_load || dev_cold_flash )
+ do_something = 1;
+#endif
+#ifdef WITH_DEVICE
+ if ( dev_check || dev_dump_fiasco || dev_dump )
+ do_something = 1;
+#endif
+#if defined(WITH_USB) || defined(WITH_DEVICE)
+ if ( dev_flash || dev_reboot || dev_ident || set_root || set_usb || set_rd || set_rd_flags || set_hw || set_kernel || set_nolo || set_sw || set_emmc )
+ do_something = 1;
+#endif
+ if ( fiasco_un || fiasco_gen || image_ident )
+ do_something = 1;
+#if defined(WITH_USB) || defined(WITH_DEVICE)
+ if ( console )
+ do_something = 1;
+#endif
+#if ( defined(WITH_USB) || defined(WITH_DEVICE) ) && defined(WITH_SQUEUES)
+ if ( queue )
+ do_something = 1;
+#endif
+ if ( help )
+ do_something = 1;
+
+ if ( ! do_something ) {
+ ERROR("Nothing to do");
+ ret = 1;
+ goto clean;
+ }
+
+ printf("\n");
+
/* help */
if ( help ) {
show_usage();