Add status current-commandline

Makes it possible to retrieve the currently executing command line as
opposed to the currently executing command (`status current-command`).

Closes #8905.
This commit is contained in:
Mahmoud Al-Qudsi
2022-10-22 14:49:11 -05:00
parent e01eb2e615
commit 6ac18defd2
5 changed files with 19 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ Synopsis
status is-full-job-control
status is-interactive-job-control
status current-command
status current-commandline
status filename
status basename
status dirname
@@ -63,6 +64,9 @@ The following operations (subcommands) are available:
**current-command**
Prints the name of the currently-running function or command, like the deprecated :envvar:`_` variable.
**current-commandline**
Prints the entirety of the currently-running commandline, inclusive of all jobs and operators.
**filename**, **current-filename**, **-f** or **--current-filename**
Prints the filename of the currently-running script. If the current script was called via a symlink, this will return the symlink. If the current script was received by piping into :doc:`source <source>`, then this will return ``-``.