@@ -40,7 +40,7 @@ class OptionOverrides(TypedDict):
40
40
41
41
42
42
class CLILoadNamespace (argparse .Namespace ):
43
- config_files : t .List [str ]
43
+ workspace_files : t .List [str ]
44
44
socket_name : t .Optional [str ]
45
45
socket_path : t .Optional [str ]
46
46
tmux_config_file : t .Optional [str ]
@@ -256,7 +256,7 @@ def _setup_plugins(builder: WorkspaceBuilder) -> Session:
256
256
257
257
258
258
def load_workspace (
259
- config_file : StrPath ,
259
+ workspace_file : StrPath ,
260
260
socket_name : t .Optional [str ] = None ,
261
261
socket_path : None = None ,
262
262
tmux_config_file : None = None ,
@@ -271,7 +271,7 @@ def load_workspace(
271
271
272
272
Parameters
273
273
----------
274
- config_file : list of str
274
+ workspace_file : list of str
275
275
paths or session names to workspace files
276
276
socket_name : str, optional
277
277
``tmux -L <socket-name>``
@@ -361,18 +361,19 @@ def load_workspace(
361
361
Accessed April 8th, 2018.
362
362
"""
363
363
# get the canonical path, eliminating any symlinks
364
- if isinstance (config_file , (str , os .PathLike )):
365
- config_file = pathlib .Path (config_file )
364
+ if isinstance (workspace_file , (str , os .PathLike )):
365
+ workspace_file = pathlib .Path (workspace_file )
366
366
367
367
tmuxp_echo (
368
- style ("[Loading] " , fg = "green" ) + style (str (config_file ), fg = "blue" , bold = True )
368
+ style ("[Loading] " , fg = "green" )
369
+ + style (str (workspace_file ), fg = "blue" , bold = True )
369
370
)
370
371
371
372
# ConfigReader allows us to open a yaml or json file as a dict
372
- raw_config = config_reader .ConfigReader ._from_file (config_file ) or {}
373
+ raw_config = config_reader .ConfigReader ._from_file (workspace_file ) or {}
373
374
374
375
# shapes configurations relative to config / profile file location
375
- sconfig = config .expand (raw_config , cwd = os .path .dirname (config_file ))
376
+ sconfig = config .expand (raw_config , cwd = os .path .dirname (workspace_file ))
376
377
# Overwrite session name
377
378
if new_session_name :
378
379
sconfig ["session_name" ] = new_session_name
@@ -382,7 +383,7 @@ def load_workspace(
382
383
t = Server ( # create tmux server object
383
384
socket_name = socket_name ,
384
385
socket_path = socket_path ,
385
- config_file = tmux_config_file ,
386
+ workspace_file = tmux_config_file ,
386
387
colors = colors ,
387
388
)
388
389
@@ -393,7 +394,7 @@ def load_workspace(
393
394
sconf = sconfig , plugins = load_plugins (sconfig ), server = t
394
395
)
395
396
except exc .EmptyConfigException :
396
- tmuxp_echo ("%s is empty or parsed no config data" % config_file )
397
+ tmuxp_echo ("%s is empty or parsed no config data" % workspace_file )
397
398
return None
398
399
399
400
session_name = sconfig ["session_name" ]
@@ -468,7 +469,7 @@ def load_workspace(
468
469
return _setup_plugins (builder )
469
470
470
471
471
- def config_file_completion (ctx , params , incomplete ):
472
+ def workspace_file_completion (ctx , params , incomplete ):
472
473
config_dir = pathlib .Path (get_config_dir ())
473
474
choices : t .List [pathlib .Path ] = []
474
475
@@ -491,8 +492,8 @@ def config_file_completion(ctx, params, incomplete):
491
492
492
493
493
494
def create_load_subparser (parser : argparse .ArgumentParser ) -> argparse .ArgumentParser :
494
- config_files = parser .add_argument (
495
- "config_files " ,
495
+ workspace_files = parser .add_argument (
496
+ "workspace_files " ,
496
497
nargs = "+" ,
497
498
metavar = "config-file" ,
498
499
help = "filepath to session or filename of session if in tmuxp config directory" ,
@@ -574,7 +575,7 @@ def create_load_subparser(parser: argparse.ArgumentParser) -> argparse.ArgumentP
574
575
try :
575
576
import shtab
576
577
577
- config_files .complete = shtab .FILE # type: ignore
578
+ workspace_files .complete = shtab .FILE # type: ignore
578
579
tmux_config_file .complete = shtab .FILE # type: ignore
579
580
log_file .complete = shtab .FILE # type: ignore
580
581
except ImportError :
@@ -629,19 +630,19 @@ def command_load(
629
630
"append" : args .append ,
630
631
}
631
632
632
- if args .config_files is None or len (args .config_files ) == 0 :
633
+ if args .workspace_files is None or len (args .workspace_files ) == 0 :
633
634
tmuxp_echo ("Enter at least one config" )
634
635
if parser is not None :
635
636
parser .print_help ()
636
637
sys .exit ()
637
638
return
638
639
639
- last_idx = len (args .config_files ) - 1
640
+ last_idx = len (args .workspace_files ) - 1
640
641
original_detached_option = tmux_options .pop ("detached" )
641
642
original_new_session_name = tmux_options .pop ("new_session_name" )
642
643
643
- for idx , config_file in enumerate (args .config_files ):
644
- config_file = scan_config (config_file , config_dir = get_config_dir ())
644
+ for idx , workspace_file in enumerate (args .workspace_files ):
645
+ workspace_file = scan_config (workspace_file , config_dir = get_config_dir ())
645
646
646
647
detached = original_detached_option
647
648
new_session_name = original_new_session_name
@@ -651,7 +652,7 @@ def command_load(
651
652
new_session_name = None
652
653
653
654
load_workspace (
654
- config_file ,
655
+ workspace_file ,
655
656
detached = detached ,
656
657
new_session_name = new_session_name ,
657
658
** tmux_options ,
0 commit comments