command-line-reference.md
This file
Path
docs/command-line-reference.md
51 lines · 1.2 KiB · Markdown
Last changed by
Add section for help page and exit codes and cross linkEdward Girlingbefore adoptionab86af3
History of this fileTake it
Very short description of exit codes and how to access them (#3112)Rowlando13before adoption868b611
lines 1–12why, one step back1# General Command Line Topics23```{currentmodule} click4```56```{contents}7---8depth: 19local: true10---11```12Add section for help page and exit codes and cross linkEdward Girlingbefore adoptionab86af3
line 13why, one step back13(exit-codes)=Very short description of exit codes and how to access them (#3112)Rowlando13before adoption868b611
lines 14–48why, one step back14## Exit Codes1516When 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.1718| Exit Code | Meaning |19|-----------|-------------------------------------------------|20| 0 | Success — the command completed without errors. |21| > 0 | Executed with errors |2223Exit codes greater than zero mean are specific to the Operating System, Shell, and/or command.2425To access the exit code, execute the command, then do the following depending:2627```{eval-rst}28.. tabs::2930 .. group-tab:: Powershell3132 .. code-block:: powershell3334 > echo $LASTEXITCODE3536 .. group-tab:: Bash3738 .. code-block:: bash3940 $ echo $?4142 .. group-tab:: Command Prompt434445 .. code-block:: text4647 > echo %ERRORLEVEL%48Add section for help page and exit codes and cross linkEdward Girlingbefore adoptionab86af3
lines 49–51why, one step back495051For Click specific behavior on exit codes, see {ref}`exception-handling-exit-codes`.