Skip to content

Commit c68c9d3

Browse files
committed
Rename tmuxp cli -> shell
1 parent c13e0ad commit c68c9d3

File tree

5 files changed

+34
-35
lines changed

5 files changed

+34
-35
lines changed

CHANGES

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Here you can find the recent changes to tmuxp
77
current
88
-------
99
- *Insert changes/features/fixes for next release here*
10-
- :issue:`636` New command: ``tmuxp cli``
10+
- :issue:`636` New command: ``tmuxp shell``
1111

1212
Accepts tmux socket_name/socket_path, automatically uses the current
1313
tmux session and window and makes them available in pdb context.
@@ -17,25 +17,25 @@ current
1717
.. code-block:: sh
1818
1919
$ pip install ipdb
20-
$ env PYTHONBREAKPOINT=ipdb.set_trace tmuxp cli
20+
$ env PYTHONBREAKPOINT=ipdb.set_trace tmuxp shell
2121
2222
You can execute python directly via ``-c``:
2323

2424
.. code-block:: sh
2525
26-
$ tmuxp cli -c 'print(session.name); print(window.name)'
26+
$ tmuxp shell -c 'print(session.name); print(window.name)'
2727
my_server
2828
my_window
2929
30-
$ tmuxp cli my_server -c 'print(session.name); print(window.name)'
30+
$ tmuxp shell my_server -c 'print(session.name); print(window.name)'
3131
my_server
3232
my_window
3333
34-
$ tmuxp cli my_server my_window -c 'print(session.name); print(window.name)'
34+
$ tmuxp shell my_server my_window -c 'print(session.name); print(window.name)'
3535
my_server
3636
my_window
3737
38-
$ tmuxp cli my_server my_window -c 'print(window.name.upper())'
38+
$ tmuxp shell my_server my_window -c 'print(window.name.upper())'
3939
MY_WINDOW
4040
4141
tmuxp 1.5.8 (2020-10-31)

README.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ Installation
1717
1818
$ pip install --user tmuxp
1919
20-
tmuxp CLI
21-
---------
22-
20+
Shell
21+
-----
2322
*New in 1.6.0*:
2423

25-
``tmuxp cli`` launches into a debugger with `libtmux`_ objects for your
26-
current server, session, and window:
24+
``tmuxp shell`` launches into a python console preloaded with the attached server,
25+
session, and window in `libtmux`_ objects.
2726

2827
.. code-block:: shell
2928
30-
$ tmuxp cli
29+
$ tmuxp shell
3130
3231
(Pdb) server
3332
<libtmux.server.Server object at 0x7f7dc8e69d10>
@@ -49,16 +48,16 @@ Python 3.7+ supports `PEP 553`_ ``breakpoint()`` (including
4948
5049
.. code-block:: shell
5150
52-
$ tmuxp cli -c 'print(window.name)'
51+
$ tmuxp shell -c 'print(window.name)'
5352
my_window
5453
55-
$ tmuxp cli -c 'print(window.name.upper())'
54+
$ tmuxp shell -c 'print(window.name.upper())'
5655
MY_WINDOW
5756
58-
Read more on `tmuxp CLI`_
57+
Read more on `tmuxp shell`_ in the CLI docs.
5958
6059
.. _PEP 553: https://www.python.org/dev/peps/pep-0553/
61-
.. _tmuxp CLI: http://localhost:8031/cli.html#launch-tmux-cli
60+
.. _tmuxp shell: http://localhost:8031/cli.html#shell
6261
6362
Load a tmux session
6463
-------------------

docs/cli.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ In zsh (``~/.zshrc``):
2222
2323
eval "$(_TMUXP_COMPLETE=source_zsh tmuxp)"
2424
25-
.. _cli_cli:
25+
.. _cli_shell:
2626

27-
tmux CLI
28-
--------
27+
Shell
28+
-----
2929

3030
::
3131

32-
tmuxp cli
32+
tmuxp shell
3333

34-
tmuxp cli <session_name>
34+
tmuxp shell <session_name>
3535

36-
tmuxp cli <session_name> <window_name>
36+
tmuxp shell <session_name> <window_name>
3737

38-
tmuxp cli -c 'python code'
38+
tmuxp shell -c 'python code'
3939

40-
Launch into a `libtmux`_ session.
40+
Launch into a python console with `libtmux`_ objects. Compare to django's shell.
4141

4242
Automatically will picked the current tmux :class:`server <libtmux.Server>`,
4343
:class:`session <libtmux.Session>`, and :class:`window <libtmux.Window>` you
@@ -65,26 +65,26 @@ compatible debuggers, for instance `ipdb`_:
6565
.. code-block:: sh
6666
6767
$ pip install ipdb
68-
$ env PYTHONBREAKPOINT=ipdb.set_trace tmuxp cli
68+
$ env PYTHONBREAKPOINT=ipdb.set_trace tmuxp shell
6969
7070
You can also pass in python code directly, similar to ``python -c``, do
7171
this via ``tmuxp -c``:
7272

7373
.. code-block:: shell
7474
75-
$ tmuxp cli -c 'print(session.name); print(window.name)'
75+
$ tmuxp shell -c 'print(session.name); print(window.name)'
7676
my_server
7777
my_window
7878
79-
$ tmuxp cli my_server -c 'print(session.name); print(window.name)'
79+
$ tmuxp shell my_server -c 'print(session.name); print(window.name)'
8080
my_server
8181
my_window
8282
83-
$ tmuxp cli my_server my_window -c 'print(session.name); print(window.name)'
83+
$ tmuxp shell my_server my_window -c 'print(session.name); print(window.name)'
8484
my_server
8585
my_window
8686
87-
$ tmuxp cli my_server my_window -c 'print(window.name.upper())'
87+
$ tmuxp shell my_server my_window -c 'print(window.name.upper())'
8888
MY_WINDOW
8989
9090
.. _PEP 553: https://www.python.org/dev/peps/pep-0553/

tests/test_cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
410410
"cli_args,inputs,expected_output",
411411
[
412412
(
413-
['cli', '-L{SOCKET_NAME}', '-c', 'print(str(server.socket_name))'],
413+
['shell', '-L{SOCKET_NAME}', '-c', 'print(str(server.socket_name))'],
414414
[],
415415
'{SERVER_SOCKET_NAME}',
416416
),
417417
(
418418
[
419-
'cli',
419+
'shell',
420420
'-L{SOCKET_NAME}',
421421
'{SESSION_NAME}',
422422
'-c',
@@ -427,7 +427,7 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
427427
),
428428
(
429429
[
430-
'cli',
430+
'shell',
431431
'-L{SOCKET_NAME}',
432432
'{SESSION_NAME}',
433433
'{WINDOW_NAME}',
@@ -439,7 +439,7 @@ def test_load_zsh_autotitle_warning(cli_args, tmpdir, monkeypatch):
439439
),
440440
],
441441
)
442-
def test_cli(cli_args, inputs, expected_output, tmpdir, monkeypatch, server, session):
442+
def test_shell(cli_args, inputs, expected_output, tmpdir, monkeypatch, server, session):
443443
monkeypatch.setenv('HOME', str(tmpdir))
444444
window_name = 'my_window'
445445
window = session.new_window(window_name=window_name)

tmuxp/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ def startup(config_dir):
661661
os.makedirs(config_dir)
662662

663663

664-
@cli.command(name='cli')
664+
@cli.command(name='shell')
665665
@click.argument('session_name', nargs=1, required=False)
666666
@click.argument('window_name', nargs=1, required=False)
667667
@click.option('-S', 'socket_path', help='pass-through for tmux -S')
@@ -671,7 +671,7 @@ def startup(config_dir):
671671
'command',
672672
help='Instead of opening shell, execute python code in libtmux and exit',
673673
)
674-
def command_cli(session_name, window_name, socket_name, socket_path, command):
674+
def command_shell(session_name, window_name, socket_name, socket_path, command):
675675
server = Server(socket_name=socket_name, socket_path=socket_path)
676676

677677
try:

0 commit comments

Comments
 (0)