Skip to content

Commit 45c2373

Browse files
committed
cli: good so far, get ready to replace conflict_handler error handlers to get -L and -S pass thru to tmux
1 parent 594964b commit 45c2373

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

tmuxp/cli.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def subcommand_load(args):
182182

183183

184184
def subcommand_attach_session(args):
185-
print('attac session')
185+
#print('attac session')
186186
for session_name in args.session_name:
187187
print(session_name)
188188

@@ -195,10 +195,10 @@ def session_complete(command, commands, ctext):
195195
commands.extend([c for c in sessions if ctext_attach in c])
196196

197197
def subcommand_kill_session(args):
198-
print('kill session')
199-
print(args)
200-
print(type(args.session_name))
201-
print(args.session_name)
198+
#print('kill session')
199+
#print(args)
200+
#print(type(args.session_name))
201+
#print(args.session_name)
202202

203203
commands = []
204204
ctext = args.session_name[0]
@@ -305,8 +305,6 @@ def main():
305305
else:
306306
if args.version:
307307
print('tmuxp %s' % __version__)
308-
elif args.kill_session:
309-
print(args.kill_session)
310308

311309
parser.print_help()
312310

@@ -322,21 +320,30 @@ def complete(cline, cpoint):
322320
metavar='socket-path')
323321

324322
parser.add_argument(
325-
dest='configs',
323+
dest='ctexta',
326324
nargs='*',
327325
type=str,
328-
default=None,
329-
)
326+
default=None,)
327+
330328

331329
args = parser.parse_args()
332330

333331
commands = []
334332

333+
335334
commands.extend(['attach-session', 'kill-session', 'load'])
336335

337336
ctext = cline.replace('tmuxp ', '')
337+
338+
338339
commands = [c for c in commands if ctext in c]
339340

341+
if args.socket_path:
342+
ctext = ctext.replace(args.socket_path or None, '')
343+
344+
if args.socket_name:
345+
ctext = ctext.replace(args.socket_name or None, '')
346+
340347
t = Server(
341348
# socket_name=args.socket_name or None,
342349
# socket_path=args.socket_path or None
@@ -360,7 +367,6 @@ def config_complete(command, commands, ctext):
360367

361368
session_complete('attach', commands, ctext)
362369
session_complete('kill-session', commands, ctext)
363-
364370
config_complete('load', commands, ctext)
365371

366372
print(' \n'.join(commands))

0 commit comments

Comments
 (0)