delve/Documentation/usage
Alessandro Arzilli caf6df0eb9
Documentation,cmd/dlv: clean up command line usage help (#3395)
Due to some very old mistakes too many of Delve's flags are declared as
persistent on cobra's root command. For example the headless flag is a
global flag but does not apply to connect, dap or trace; the backend
flag does not apply to replay, core and dap; etc.

Almost all global flags should have been declared as local flags on
individual subcommands. Unfortunately we can not change this without
breaking backwards compatibility, for example:

   dlv --headless debug

would not parse if headless was a flag of debug instead of a global
flag.

Instead we alter usage function and the markdown generation script to
strategically hide the flags that don't apply.

Fixes #2361
2023-08-09 10:37:55 -07:00
..
dlv_attach.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv_backend.md commmands: update DAP overview in help (#2850) 2022-01-06 08:57:40 -08:00
dlv_connect.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv_core.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv_dap.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv_debug.md cmd/dlv,service/dap: use randomized name as default output binary (#3366) 2023-05-16 09:36:15 -07:00
dlv_exec.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv_log.md proc: read context from sigtrampgo, fixes TestCgoStacktrace2 on 1.21 (#3401) 2023-06-27 09:33:07 -07:00
dlv_redirect.md commmands: update DAP overview in help (#2850) 2022-01-06 08:57:40 -08:00
dlv_replay.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv_run.md commmands: update DAP overview in help (#2850) 2022-01-06 08:57:40 -08:00
dlv_test.md cmd/dlv,service/dap: use randomized name as default output binary (#3366) 2023-05-16 09:36:15 -07:00
dlv_trace.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv_version.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
dlv.md Documentation,cmd/dlv: clean up command line usage help (#3395) 2023-08-09 10:37:55 -07:00
README.md terminal: send large output to pager (#3060) 2022-08-17 09:02:53 +02:00

Using Delve

You can invoke Delve in multiple ways, depending on your usage needs. Delve makes every attempt to be user-friendly, ensuring the user has to do the least amount of work possible to begin debugging their program.

The available commands can be grouped into the following categories:

The above list may be incomplete. Refer to the auto-generated complete usage document to further explore all available commands.

Environment variables

Delve also reads the following environment variables:

  • $DELVE_EDITOR is used by the edit command (if it isn't set the $EDITOR variable is used instead)
  • $DELVE_PAGER is used by commands that emit large output (if it isn't set the $PAGER variable is used instead, if neither is set more is used)
  • $TERM is used to decide whether or not ANSI escape codes should be used for colorized output
  • $DELVE_DEBUGSERVER_PATH is used to locate the debugserver executable on macOS