using GLib; using Pluie; int main (string[] argv) { int done = 0; var nostate = false; Echo.init (bool.parse("@DEBUG@")); Dbg.in (Log.METHOD); var p = new PrayTime ("@DATA_PATH@", "@INSTALL_PATH@", "@VERSION@"); if (argv.length > 1) { if (argv[1] == "version") { stdout.printf (p.version); nostate = true; } else { of.title ("PrayTime", p.version, "a-sansara"); switch (argv[1]) { case "cron" : p.init_cron (); break; case "play" : if (argv.length > 2) { done = p.play_adhan (argv[2]); } else { of.error ("missing pray parameter"); done = 1; } break; default : of.warn ("invalid command %s".printf (argv[1])); p.usage(); done = 1; break; } } } else { p.infos (); } of.echo (); if (!nostate) { of.rs (done == 0); of.echo (); } Dbg.out (Log.METHOD); return done; }