Skip to content
Myr

Merge pull request #1166 from shadowspawn/feature/vscode-debugging

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add VSCode tip and rework debugging section

authored by John Gee · committed by GitHub · parents 6857562, dd68652 · Browse files · 1 file+7 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−3 removed

  • other:+7 added−3 removed

1 file+7 added−3 removed

modified:Readme.md+7 added-3 removed
33 unmodified lines
34 - [Bits and pieces](#bits-and-pieces)35 - [Avoiding option name clashes](#avoiding-option-name-clashes)36 - [TypeScript](#typescript)37 - [Node options such as `--harmony`](#node-options-such-as---harmony)38 - [Node debugging](#node-debugging)38 - [Debugging executable subcommands](#debugging-executable-subcommands)39 - [Override exit handling](#override-exit-handling)40 - [Examples](#examples)41 - [License](#license)42 - [Support](#support)
608 unmodified lines
651652- Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. (Note Windows does not support this pattern.)653- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.654655### Node debugging655### Debugging executable subcommands656657An executable subcommand is launched as a separate child process.658657If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) git-style executable (sub)commands using `node --inspect` et al,659If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al,660the inspector port is incremented by 1 for the spawned subcommand.661662If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration.663664### Override exit handling665666By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override667this behaviour and optionally supply a callback. The default override throws a `CommanderError`.
71 unmodified lines