command-line-reference.md
This file
Path
docs/command-line-reference.md
50 lines · 1.2 KiB · Markdown
Last changed by
Fix typo. Add no_args_is help example.Edward Girlingbefore adoptionf39d2d5
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–47why, 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%Fix typo. Add no_args_is help example.Edward Girlingbefore adoptionf39d2d5
line 48why, one step back48```Add section for help page and exit codes and cross linkEdward Girlingbefore adoptionab86af3
lines 49–50why, one step back4950For Click specific behavior on exit codes, see {ref}`exception-handling-exit-codes`.