Skip to content

Commit 0ed2d3f

Browse files
committed
tmux -v now displays tmuxp version
1 parent 8b39d2b commit 0ed2d3f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tmuxp/cli.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
from . import config
1616
from distutils.util import strtobool
1717
from . import log, util, exc, WorkspaceBuilder, Server
18+
import pkg_resources
19+
20+
__version__ = pkg_resources.require("tmuxp")[0].version
1821

1922
logger = logging.getLogger(__name__)
2023

@@ -172,6 +175,11 @@ def main():
172175
parser.add_argument(
173176
'-l', '--list', dest='list_configs', action='store_true',
174177
help='List config files available')
178+
179+
parser.add_argument(
180+
'-v', '--version', dest='version', action='store_true',
181+
help='Prints the tmuxp version')
182+
175183
parser.add_argument('--log-level', dest='log_level', default='INFO',
176184
help='Log level')
177185

@@ -184,7 +192,9 @@ def main():
184192
logger.error(e)
185193
sys.exit()
186194

187-
if args.list_configs:
195+
if args.version:
196+
print('tmuxp %s' % __version__)
197+
elif args.list_configs:
188198
startup(config_dir)
189199
configs_in_user = config.in_dir(config_dir)
190200
configs_in_cwd = config.in_cwd()

0 commit comments

Comments
 (0)