summary refs log tree commit diff stats
path: root/setup.py
Commit message (Expand)AuthorAgeFilesLines
* Python 3 division: Import `division` from `__future__`nfnty2017-01-211-1/+1
* linting: Fix Travis CInfnty2017-01-171-2/+2
* linting: Python 2 compat: Import from `__future__`nfnty2017-01-171-0/+2
* linting: pylint and flake8nfnty2017-01-171-8/+10
* linting: autopep8nfnty2017-01-171-2/+6
* Remove reduntant backslash between brackets.stepshal2016-06-191-1/+1
* Add two blank lines where is expectedstepshal2016-06-161-0/+1
* Revert "Use setuptools if present"hut2016-01-251-7/+2
* added ranger.desktop file, fixes #346hut2016-01-251-0/+2
* setup.py: fix CHANGELOG.md referencehut2015-07-161-1/+1
* Use setuptools if presentShadab Zafar2015-06-251-2/+7
* moved "doc/examples" to "examples" for more visibilityhut2015-04-131-1/+1
* Neater copyright headerhut2015-03-191-2/+2
* Fixed references to doc/HACKING (for real)Dorien Snake2014-12-101-1/+1
* Fixed references to doc/HACKINGDorien Snake2014-12-101-1/+1
* fix references to README.mdhut2014-08-221-1/+1
* Changed email address in source codehut2013-08-081-1/+1
* added doc/config directory with symlinks to configshut2013-03-151-9/+4
* setup.py: added _findall functionhut2013-03-091-7/+6
* setup.py: create a /usr/share/doc/ranger directoryhut2013-03-091-1/+26
* setup.py: updated website URLhut2013-03-011-1/+1
* setup.py: removed fsobject packagehut2013-03-011-1/+0
* Merge branch 'master' into vcshut2013-02-221-1/+1
|\
| * updated rest of the copyright noticeshut2013-02-221-1/+1
| * update email address (romanz@lavabit.com -> hut@lavabit.com)hut2013-02-221-1/+1
* | Merge branch 'master' into vcshut2013-02-191-1/+1
|\|
| * setup.py: add doc/rifle.1 to man pageshut2013-02-181-1/+1
* | setup.py: s/ranger.vcs/ranger.ext.vcs/hut2013-02-161-1/+1
* | Merged code to manipulate version control systemsAbdo Roig-Maranges2013-02-121-1/+2
|/
* replaced tabs with 4 spaces in all python fileshut2013-02-101-23/+23
* added scripts directory. rifle is now installed to /usr/bin/hut2012-08-041-1/+1
* setup.py: s/defaults/config/hut2012-08-021-3/+3
* setup.py: added entry for rifle.confhut2012-03-191-1/+2
* shorten all copyright messages for better readabilityhut2012-03-141-13/+1
* moved scripts/ranger to ranger/data/rangerhut2011-10-111-1/+1
* Updated copyright headershut2011-10-101-1/+1
* added defaults/rc.conf in setup.pyhut2011-09-301-1/+1
* Fixed setup.py (by removing ranger/help entry)hut2011-09-291-2/+1
* a little restructurationhut2010-10-021-2/+2
* Makefile, setup.py: Fixed `make doc`hut2010-09-111-23/+24
* added setup.py drafthut2010-06-181-0/+42
/main.c?id=5d9c7ffd9c27c1f097f71ccf940525121faefd12'>5d9c7ffd ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  

         
                                                           
  
















                                                                       

                 

                   

                      

                                    
                          
 

                           

                                   


                                                                                             
                                                                                                                       

                
 

                            
 

                                                              

                                                                 
                                       
                 
     
 

                                   

                                                            
                                                                                   




                                                                                                   

     
                               


             
/*
 * main.c
 *
 * Copyright (C) 2012, 2013 James Booth <boothj5@gmail.com>
 *
 * This file is part of Profanity.
 *
 * Profanity is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Profanity is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Profanity.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <glib.h>

#include "config.h"

#include "profanity.h"

static gboolean disable_tls = FALSE;
static gboolean version = FALSE;
static char *log = "INFO";

int
main(int argc, char **argv)
{
    static GOptionEntry entries[] =
    {
        { "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Show version information", NULL },
        { "disable-tls", 'd', 0, G_OPTION_ARG_NONE, &disable_tls, "Disable TLS", NULL },
        { "log",'l', 0, G_OPTION_ARG_STRING, &log, "Set logging levels, DEBUG, INFO (default), WARN, ERROR", "LEVEL" },
        { NULL }
    };

    GError *error = NULL;
    GOptionContext *context;

    context = g_option_context_new(NULL);
    g_option_context_add_main_entries(context, entries, NULL);
    if (!g_option_context_parse(context, &argc, &argv, &error)) {
        g_print("%s\n", error->message);
        g_option_context_free(context);
        return 1;
    }

    g_option_context_free(context);

    if (version == TRUE) {
        g_print("Profanity, version %s\n", PACKAGE_VERSION);
        g_print("Copyright (C) 2012, 2013 James Booth <%s>.\n", PACKAGE_BUGREPORT);
        g_print("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
        g_print("\n");
        g_print("This is free software; you are free to change and redistribute it.\n");
        g_print("There is NO WARRANTY, to the extent permitted by law.\n");
        return 0;
    }

    prof_run(disable_tls, log);

    return 0;
}