-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added debug_launch_args example. #10
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "debug_launch_args" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
## How to configure debug launch arguments | ||
|
||
Visual Studio's Open Folder mode allows configuring the | ||
arguments for a debugger launch using a `launch.vs.json` | ||
file. This file can be placed in the `.vs` directory, | ||
or, as in this example, as a sibling to `Cargo.toml`. | ||
|
||
``` | ||
{ | ||
"version": "0.2.1", | ||
"defaults": { | ||
}, | ||
"configurations": [ | ||
{ | ||
"type": "default", | ||
"name": "Bin: debug_launch_args/debug_launch_args", | ||
"project": "Cargo.toml", | ||
"projectTarget": "debug_launch_args/debug_launch_args", | ||
"args": | ||
[ | ||
"--flag", | ||
"value" | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
- `type` must be "default" | ||
- `projectTarget` is the name of the package and the name of the target, separated by a slash | ||
- `project` must be "Cargo.toml" | ||
- `name` must be the same as projectTarget, except with "Bin: " or "Example: ", to indicate what kind of target. Note the space after the colon. | ||
- `args` is a json array of strings, which will be the arguments passed to the executable being debugged | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": "0.2.1", | ||
"defaults": { | ||
}, | ||
"configurations": [ | ||
{ | ||
"type": "default", | ||
"name": "Bin: debug_launch_args/debug_launch_args", | ||
"project": "Cargo.toml", | ||
"projectTarget": "debug_launch_args/debug_launch_args", | ||
"args": | ||
[ | ||
"--flag", | ||
"value" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use std::env; | ||
|
||
fn main() { | ||
let args: Vec<String> = env::args().collect(); | ||
dbg!(args); | ||
} |