split dump and display
Let's create a specific function to dump instead of managing with ncurses
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>Index: powerdebug/powerdebug.c
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
diff --git a/powerdebug.c b/powerdebug.c
index 7eb9c5e..bb024fc 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -341,6 +341,12 @@
return 0;
}
+static int powerdebug_dump(struct powerdebug_options *options,
+ struct regulator_info *reg_info, int nr_reg)
+{
+ return 0;
+}
+
int main(int argc, char **argv)
{
struct powerdebug_options *options;
@@ -364,6 +370,13 @@
return 1;
}
+ /* we just dump the informations */
+ if (options->dump) {
+ if (powerdebug_dump(options, regulators_info, numregulators))
+ return 1;
+ return 0;
+ }
+
if (mainloop(options, regulators_info, numregulators))
return 1;