Fix typo
[kdepim.git] / ksendemail / main.cpp
blob98ea128dab2daf9979afc51df52595629f0e32cb
1 /*
2 This file is part of KSendEmail.
3 Copyright (c) 2008 Pradeepto Bhattacharya <pradeepto@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #include "mailerservice.h"
23 #include <kaboutdata.h>
24 #include <kapplication.h>
25 #include <kcmdlineargs.h>
27 static const char description[] =
28 I18N_NOOP( "KDE Command Line Emailer." );
30 static KCmdLineOptions kmail_options ()
32 KCmdLineOptions options;
33 options.add("s");
34 options.add("subject <subject>", ki18n("Set subject of message"));
35 options.add("c");
36 options.add("cc <address>", ki18n("Send CC: to 'address'"));
37 options.add("b");
38 options.add("bcc <address>", ki18n("Send BCC: to 'address'"));
39 options.add("h");
40 options.add("header <header>", ki18n("Add 'header' to message"));
41 options.add("msg <file>", ki18n("Read message body from 'file'"));
42 options.add("body <text>", ki18n("Set body of message"));
43 options.add("attach <url>", ki18n("Add an attachment to the mail. This can be repeated"));
44 options.add("composer", ki18n("Only open composer window"));
45 options.add("+[address]", ki18n("Address to send the message to"));
46 return options;
50 int main( int argc, char **argv )
52 KAboutData aboutData( "ksendemail", 0, ki18n( "KSendEmail" ), "0.01", ki18n(description),
53 KAboutData::License_GPL,
54 ki18n( "(C) 2008 Pradeepto Bhattacharya" ),
55 KLocalizedString(), "http://kontact.kde.org" );
57 aboutData.addAuthor( ki18n( "Pradeepto Bhattacharya" ), KLocalizedString(), "pradeepto@kde.org" );
59 KCmdLineArgs::init( argc, argv, &aboutData );
60 KCmdLineArgs::addCmdLineOptions( kmail_options() );
62 KApplication app;
64 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
66 MailerService *ms = new MailerService();
67 ms->processArgs( args );
68 args->clear();
69 delete ms;
70 return 0;