gint cmd_get(gint argc, gchar **argv) { struct setup_query_s sq; if (setup_opts(argc, argv, &lopts) != EXIT_SUCCESS) return (EXIT_FAILURE); if (lutil_parse_input(&linput, (const gchar**) opts.rargs) != EXIT_SUCCESS) return (EXIT_FAILURE); if (setup_quvi(&q) != EXIT_SUCCESS) { linput_free(&linput); return (EXIT_FAILURE); } memset(&sq, 0, sizeof(struct setup_query_s)); sq.force_subtitle_mode = opts.core.print_subtitles; sq.activity.playlist = _foreach_playlist_url; sq.activity.subtitle = _foreach_subtitle_url; sq.activity.media = _foreach_media_url; sq.perr = lutil_print_stderr_unless_quiet; sq.xperr = lprint_enum_errmsg; sq.linput = &linput; sq.q = q; sigwinch_setup(&saw, &sao); return (_cleanup(setup_query(&sq))); }
int main(int argc, char **argv) { struct opts opts; setup_opts(&opts, argc, argv); debug(&opts, VERSION " starting...\n"); debug_printopts(&opts); return run_wrapped(&opts); }
int main(int argc, char **argv) { ClientApp app; NGetOpt<ClientApp> opts(argc, argv, &app, 1); setup_opts(&opts); try { if (opts.proccess()) { app.run(); } } catch (NException &e) { NWarning::print() << "Error: " << e.getDescription(); exit(1); } return 0; }