mirror of
https://github.com/gryf/urxvt-wrapper.git
synced 2025-12-17 11:30:21 +01:00
Added argument parsing
This commit is contained in:
33
urxvt.py
33
urxvt.py
@@ -1,4 +1,11 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Wrapper for launchin urxvt terminal emulator. It supports automatically
|
||||
generated font list for normal and bold typefaces, setting up bitmap font as a
|
||||
main one, selecting an icon and so on.
|
||||
|
||||
Consult options below.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
@@ -93,6 +100,32 @@ def _get_font_list(ff_list, bold=False, bmp_first=False):
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('-d', '--default-font', default=DEFAULT_FONT,
|
||||
help='use particular (comma separated) font face(s) '
|
||||
'as default(s) one, should be provided by font name, '
|
||||
'not file name(s), default is "%s"' % DEFAULT_FONT)
|
||||
parser.add_argument('-b', '--bitmap', action='store_true', help='use '
|
||||
'bitmap font in addition to scalable defined above')
|
||||
parser.add_argument('-i', '--icon', default=ICON, help='select icon from '
|
||||
'%s, default "%s"' % (ICON_PATH, ICON))
|
||||
parser.add_argument('-t', '--tabbedalt', action='store_true',
|
||||
help='activate tabbedalt extension')
|
||||
parser.add_argument('-s', '--size', default=SIZE, type=int,
|
||||
help='set scalable forn size, default %s' % SIZE)
|
||||
|
||||
parser.add_argument('-e', '--exec', help='pass exec to urxvt')
|
||||
parser.add_argument('-n', '--no-perl', action='store_true',
|
||||
help='no perl extensions')
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument("-q", "--quiet", help='please, be quiet. Adding more '
|
||||
'"q" will decrease verbosity', action="count",
|
||||
default=0)
|
||||
group.add_argument("-v", "--verbose", help='be verbose. Adding more "v" '
|
||||
'will increase verbosity', action="count", default=0)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
font_faces = _ADDITIONAL_FONTS[:]
|
||||
font_faces.insert(0, DEFAULT_TTF)
|
||||
regular = _get_font_list(font_faces)
|
||||
|
||||
Reference in New Issue
Block a user