Skip to content

Commit 90d0d2a

Browse files
authored
Merge pull request #190 from eecs280staff/cla-example
Use P1 for Command-Line Argument Example
2 parents 10c495e + f721366 commit 90d0d2a

File tree

8 files changed

+79
-49
lines changed

8 files changed

+79
-49
lines changed

docs/images/visualstudio149.png

73.5 KB
Loading

docs/images/xcode259.png

-2.95 KB
Loading

docs/setup_gdb.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,26 @@ We recommend enabling the address sanitizer and undefined behavior sanitizer. Th
9292

9393
First, edit your `Makefile` and add the `CXXFLAGS` recommended by the [ASAN Quick Start](setup_asan.html#quick-start).
9494

95-
### Arguments and options
96-
Arguments and options are inputs to a program typed at the command line. Here's an example from EECS 280 Project 4:
95+
### Command-Line Arguments and Options
96+
97+
<!-- Preserve links to old section heading "Arguments and Options" -->
98+
<a id="arguments-and-options"></a>
99+
100+
Inputs to a program may be provided when it is initially run via command-line arguments or options. Here's an example from EECS 280 Project 1:
101+
97102
```console
98-
$ ./main.exe train_small.csv test_small.csv --debug
103+
$ ./two_sample.exe HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
99104
```
100-
{: data-variant="no-line-numbers" data-highlight="1" }
101105

102-
- `main.exe` is the name of the program
103-
- `train_small.csv` and `test_small.csv` are arguments
104-
- `--debug` is an option
106+
- `./two_sample.exe` is used to run the program
107+
- Each of `HCMST_ver_3.04.tsv`, `q24_met_online`, `1`, `0`, `ppage` are passed to it as arguments
108+
109+
The arguments above specify the name of a data file, coulumns, and filter values for the program to use.
105110

106-
To run a program with options or arguments in LLDB, inc
111+
To run a program with options or arguments in GDB, include them after `r`.
107112
```console
108113
$ gdb main.exe
109-
(gdb) r train_small.csv test_small.csv --debug
114+
(gdb) r HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
110115
```
111116
{: data-highlight="2" }
112117

docs/setup_lldb.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,26 @@ We recommend enabling the address sanitizer and undefined behavior sanitizer. Th
9191

9292
First, edit your `Makefile` and add the `CXXFLAGS` recommended by the [ASAN Quick Start](setup_asan.html#quick-start).
9393

94-
### Arguments and options
95-
Arguments and options are inputs to a program typed at the command line. Here's an example from EECS 280 Project 4:
94+
### Command-Line Arguments and Options
95+
96+
<!-- Preserve links to old section heading "Arguments and Options" -->
97+
<a id="arguments-and-options"></a>
98+
99+
Inputs to a program may be provided when it is initially run via command-line arguments or options. Here's an example from EECS 280 Project 1:
100+
96101
```console
97-
$ ./main.exe train_small.csv test_small.csv --debug
102+
$ ./two_sample.exe HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
98103
```
99-
{: data-variant="no-line-numbers" data-highlight="1" }
100104

101-
- `main.exe` is the name of the program
102-
- `train_small.csv` and `test_small.csv` are arguments
103-
- `--debug` is an option
105+
- `./two_sample.exe` is used to run the program
106+
- Each of `HCMST_ver_3.04.tsv`, `q24_met_online`, `1`, `0`, `ppage` are passed to it as arguments
107+
108+
The arguments above specify the name of a data file, coulumns, and filter values for the program to use.
104109

105110
To run a program with options or arguments in LLDB, include them after `r`.
106111
```console
107112
$ lldb main.exe
108-
(lldb) r train_small.csv test_small.csv --debug
113+
(lldb) r HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
109114
```
110115
{: data-highlight="2" }
111116

docs/setup_visualstudio.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,25 @@ Visual Studio provides an address sanitizer with bounds checking automatically w
209209

210210
</div>
211211

212-
### Arguments and options
212+
### Command-Line Arguments and Options
213+
214+
<!-- Preserve links to old section heading "Arguments and Options" -->
215+
<a id="arguments-and-options"></a>
216+
213217
<div class="primer-spec-callout info" markdown="1">
214218
Skip this subsection your first time through the tutorial. You can come back to it.
215219
</div>
216220

217-
Arguments and options are inputs to a program typed at the command line. Here's an example from EECS 280 Project 4:
221+
Inputs to a program may be provided when it is initially run via command-line arguments or options. Here's an example from EECS 280 Project 1:
222+
218223
```console
219-
$ ./main.exe train_small.csv test_small.csv --debug
224+
$ ./two_sample.exe HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
220225
```
221-
{: data-variant="no-line-numbers" data-highlight="1" }
222226

223-
- `main.exe` is the name of the program
224-
- `train_small.csv` and `test_small.csv` are arguments
225-
- `--debug` is an option
227+
- `./two_sample.exe` is used to run the program
228+
- Each of `HCMST_ver_3.04.tsv`, `q24_met_online`, `1`, `0`, `ppage` are passed to it as arguments
229+
230+
The arguments above specify the name of a data file, coulumns, and filter values for the program to use.
226231

227232
Right-click the project in the Solution Explorer (`p1-stats` in this example). Select "Properties".
228233

docs/setup_vscode_macos.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,29 +303,34 @@ Open Settings on VSCode (Code > Settings > Settings). Search for "lldb: show dis
303303

304304
<img src="images/vscode_macos_037.png" width="768px" />
305305

306-
### Arguments and options
306+
### Command-Line Arguments and Options
307+
308+
<!-- Preserve links to old section heading "Arguments and Options" -->
309+
<a id="arguments-and-options"></a>
310+
307311
<div class="primer-spec-callout info" markdown="1">
308312
Skip this subsection your first time through the tutorial. You can come back to it.
309313
</div>
310314

311-
Arguments and options are inputs to a program typed at the command line. Here's an example from EECS 280 Project 4:
315+
Inputs to a program may be provided when it is initially run via command-line arguments or options. Here's an example from EECS 280 Project 1:
316+
312317
```console
313-
$ ./main.exe train_small.csv test_small.csv --debug
318+
$ ./two_sample.exe HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
314319
```
315-
{: data-variant="no-line-numbers" data-highlight="1" }
316320

317-
- `main.exe` is the name of the program
318-
- `train_small.csv` and `test_small.csv` are arguments
319-
- `--debug` is an option
321+
- `./two_sample.exe` is used to run the program
322+
- Each of `HCMST_ver_3.04.tsv`, `q24_met_online`, `1`, `0`, `ppage` are passed to it as arguments
323+
324+
The arguments above specify the name of a data file, coulumns, and filter values for the program to use.
320325

321-
To run a program with options or arguments in VS Code, edit `launch.json`. Each option or argument should goes in a separate comma-separated string.
326+
To run a program with options or arguments in VS Code, edit `launch.json`. Each option or argument goes in a separate comma-separated string.
322327
```json
323328
{
324329
"configurations": [
325330
{
326331
...
327332
"program": "${workspaceFolder}/main.exe",
328-
"args": ["train_small.csv", "test_small.csv", "--debug"],
333+
"args": ["HCMST_ver_3.04.tsv", "q24_met_online", "1", "0", "ppage"],
329334
...
330335
}
331336
]

docs/setup_vscode_wsl.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -373,29 +373,34 @@ Edit the `"environment"` property in your `launch.json`. If there's already an
373373
```
374374
{: data-highlight="3-4" }
375375

376-
### Arguments and options
376+
### Command-Line Arguments and Options
377+
378+
<!-- Preserve links to old section heading "Arguments and Options" -->
379+
<a id="arguments-and-options"></a>
380+
377381
<div class="primer-spec-callout info" markdown="1">
378382
Skip this subsection your first time through the tutorial. You can come back to it.
379383
</div>
380384

381-
Arguments and options are inputs to a program typed at the command line. Here's an example from EECS 280 Project 4:
385+
Inputs to a program may be provided when it is initially run via command-line arguments or options. Here's an example from EECS 280 Project 1:
386+
382387
```console
383-
$ ./main.exe train_small.csv test_small.csv --debug
388+
$ ./two_sample.exe HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
384389
```
385-
{: data-variant="no-line-numbers" data-highlight="1" }
386390

387-
- `main.exe` is the name of the program
388-
- `train_small.csv` and `test_small.csv` are arguments
389-
- `--debug` is an option
391+
- `./two_sample.exe` is used to run the program
392+
- Each of `HCMST_ver_3.04.tsv`, `q24_met_online`, `1`, `0`, `ppage` are passed to it as arguments
393+
394+
The arguments above specify the name of a data file, coulumns, and filter values for the program to use.
390395

391-
To run a program with options or arguments in VS Code, edit `launch.json`. Each option or argument should goes in a separate comma-separated string.
396+
To run a program with options or arguments in VS Code, edit `launch.json`. Each option or argument goes in a separate comma-separated string.
392397
```json
393398
{
394399
"configurations": [
395400
{
396401
...
397402
"program": "${workspaceFolder}/main.exe",
398-
"args": ["train_small.csv", "test_small.csv", "--debug"],
403+
"args": ["HCMST_ver_3.04.tsv", "q24_met_online", "1", "0", "ppage"],
399404
...
400405
}
401406
]

docs/setup_xcode.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,25 @@ Select your scheme, then "Edit Scheme". You can also use menu: Product > Scheme
229229

230230
<img src="images/xcode170.png" width="768px" />
231231

232-
### Arguments and options
232+
### Command-Line Arguments and Options
233+
234+
<!-- Preserve links to old section heading "Arguments and Options" -->
235+
<a id="arguments-and-options"></a>
236+
233237
<div class="primer-spec-callout info" markdown="1">
234238
Skip this subsection your first time through the tutorial. You can come back to it.
235239
</div>
236240

237-
Arguments and options are inputs to a program typed at the command line. Here's an example from EECS 280 Project 4:
241+
Inputs to a program may be provided when it is initially run via command-line arguments or options. Here's an example from EECS 280 Project 1:
242+
238243
```console
239-
$ ./main.exe train_small.csv test_small.csv --debug
244+
$ ./two_sample.exe HCMST_ver_3.04.tsv q24_met_online 1 0 ppage
240245
```
241-
{: data-variant="no-line-numbers" data-highlight="1" }
242246

243-
- `main.exe` is the name of the program
244-
- `train_small.csv` and `test_small.csv` are arguments
245-
- `--debug` is an option
247+
- `./two_sample.exe` is used to run the program
248+
- Each of `HCMST_ver_3.04.tsv`, `q24_met_online`, `1`, `0`, `ppage` are passed to it as arguments
249+
250+
The arguments above specify the name of a data file, coulumns, and filter values for the program to use.
246251

247252
Select your scheme, then "Edit Scheme". You can also use menu: Product > Scheme > Edit Scheme.
248253

0 commit comments

Comments
 (0)