A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
fatal-command-line-duplicate-option-example.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 Lawrence Livermore National Laboratory
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
7
*/
8
9
#include "ns3/core-module.h"
10
11
/**
12
* @file
13
* @ingroup core-examples
14
* @ingroup commandline
15
* Example program illustrate the abort due to duplicate non-option in ns3::CommandLine.
16
*/
17
18
using namespace
ns3
;
19
20
int
21
main(
int
argc,
char
* argv[])
22
{
23
int
intArg = 1;
24
int
intArg2 = 1;
25
CommandLine
cmd
(__FILE__);
26
cmd
.Usage(
"This program is expected to abort due to duplicate option definition."
);
27
cmd
.AddValue(
"intArg"
,
"int argument"
, intArg);
28
cmd
.AddValue(
"intArg"
,
"int argument"
, intArg2);
29
cmd
.Parse(argc, argv);
30
return
0;
31
}
ns3::CommandLine
Parse command-line arguments.
Definition
command-line.h:221
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
second.cmd
cmd
Definition
second.py:29
src
core
test
fatal-command-line-duplicate-option-example.cc
Generated on
for ns-3 by
1.15.0