Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/command-line-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# General Command Line Topics

```{currentmodule} click
```

```{contents}
---
depth: 1
local: true
---
```

## Exit Codes

When a command is executed from the command line, then an exit code is return. The exit code, also called exit status or exit status code, is a positive integer that tells you whether the command executed with or without errors.

| Exit Code | Meaning |
|-----------|-------------------------------------------------|
| 0 | Success — the command completed without errors. |
| > 0 | Executed with errors |

Exit codes greater than zero mean are specific to the Operating System, Shell, and/or command.

To access the exit code, execute the command, then do the following depending:

```{eval-rst}
.. tabs::

.. group-tab:: Powershell

.. code-block:: powershell

> echo $LASTEXITCODE

.. group-tab:: Bash

.. code-block:: bash

$ echo $?

.. group-tab:: Command Prompt


.. code-block:: text

> echo %ERRORLEVEL%

```
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ General Reference
utils
shell-completion
exceptions
command-line-reference
unicode-support
wincmd

Expand Down