powerline/scripts/powerline-config

38 lines
952 B
Python
Executable File

#!/usr/bin/env python
# vim:fileencoding=utf-8:noet
'''Script used to obtain powerline configuration'''
import argparse
try:
import powerline.bindings.config as config
except ImportError:
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(os.path.realpath(__file__)))))
import powerline.bindings.config as config # NOQA
TMUX_ACTIONS = {
'source': config.source_tmux_files,
}
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
subparsers = parser.add_subparsers()
tmux_parser = subparsers.add_parser('tmux', help='Tmux-specific commands')
tmux_parser.add_argument(
'function',
choices=tuple(TMUX_ACTIONS.values()),
metavar='action',
type=(lambda v: TMUX_ACTIONS.get(v)),
help='If action is "source" then version-specific tmux configuration files are sourced.'
)
args = parser.parse_args()
pl = config.create_powerline_logger(args)
args.function(pl, args)