summaryrefslogtreecommitdiffstats
path: root/FusionIcon/parser.py
blob: 9b581455324845e3a4cade183258aa04b1bd0b1f (plain)
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
# This file is part of Fusion-icon.

# Fusion-icon 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 2 of the License, or
# (at your option) any later version.
#
# Fusion-icon 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 this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): crdlb
# Copyright 2007 Christopher Williams <christopherw@verizon.net> 

from optparse import OptionParser, OptionGroup

parser = OptionParser(usage='usage: %prog [options|action]', version='%prog-0.0.0')

parser.add_option('--reset', action='store_true', dest='reset',
	help='remove configuration file and exit')

parser.add_option('-s', '--sleep', type='int', dest='seconds',
	help='Sleep before launching')

parser.add_option('-v', '--verbose', action='store_true', dest='verbose',
	help='Print extra output')

interface_group = OptionGroup(parser, 'Interface Options')

interface_group.add_option('-i', '--interface', dest='interface',
	help='Try a certain interface first')

interface_group.add_option('-u', '--no-interface', action='store_true', dest='no_interface',
	help='Do not use any interface')

parser.add_option_group(interface_group)

startup_group = OptionGroup(parser, 'Startup Options')

startup_group.add_option('-f', '--force-compiz', action='store_true', dest='force_compiz',
	help='Start compiz regardless of environment or configuration')

startup_group.add_option('-n', '--no-start', action='store_true', dest='no_start',
	help='Run, but do not start a window manager')

parser.add_option_group(startup_group)

options, args = parser.parse_args()

# fusion-icon accepts no arguments
if args:
	parser.error('no such argument: %s' %args[0])