--- smsdaemon/smsqueue.cpp 2008/12/08 21:49:49 158 +++ smsdaemon/smsqueue.cpp 2008/12/18 06:53:29 196 @@ -23,46 +23,55 @@ string recipient; string message; - if (!(argc == 3 || argc == 4)) { + if (!(argc == 3 || argc == 4)) + { printUsage(); return 0; } if ( string(argv[1]) == "-m") { - if (argc != 4) { + if (argc != 4) + { printUsage(); return 0; } message = string(argv[2]); recipient = string(argv[3]); - } - else + } + else { - if (argc != 3) { + if (argc != 3) + { printUsage(); return 0; } - try { + try + { message = Util::readfile(string(argv[1])); - } catch(exception& e) { + } + catch (exception& e) + { cout << e.what() << endl; return -1; } recipient = string(argv[2]); } - + srand(time(0)); Spooler spool; - try { + try + { spool.enqueue(recipient,message); cout << "enqueued as: " << spool.getFilename() << endl; - } catch (std::exception& e) { + } + catch (std::exception& e) + { cout << e.what() << endl; return -1; } - + return 0; }