equal
deleted
inserted
replaced
19 */ |
19 */ |
20 #include "command-line.h" |
20 #include "command-line.h" |
21 #include "log.h" |
21 #include "log.h" |
22 #include "config.h" |
22 #include "config.h" |
23 #include "global-value.h" |
23 #include "global-value.h" |
|
24 #include "type-id.h" |
24 #include "string.h" |
25 #include "string.h" |
25 #include <stdlib.h> |
26 #include <stdlib.h> |
26 |
27 |
27 NS_LOG_COMPONENT_DEFINE ("CommandLine"); |
28 NS_LOG_COMPONENT_DEFINE ("CommandLine"); |
28 |
29 |
107 { |
108 { |
108 for (GlobalValue::Iterator i = GlobalValue::Begin (); i != GlobalValue::End (); ++i) |
109 for (GlobalValue::Iterator i = GlobalValue::Begin (); i != GlobalValue::End (); ++i) |
109 { |
110 { |
110 std::cout << " --" << (*i)->GetName () << "=["; |
111 std::cout << " --" << (*i)->GetName () << "=["; |
111 Ptr<const AttributeChecker> checker = (*i)->GetChecker (); |
112 Ptr<const AttributeChecker> checker = (*i)->GetChecker (); |
112 Attribute value = (*i)->GetValue (); |
113 StringValue v; |
113 std::cout << value.SerializeToString (checker) << "]: " |
114 (*i)->GetValue (v); |
|
115 std::cout << v.Get () << "]: " |
114 << (*i)->GetHelp () << std::endl; |
116 << (*i)->GetHelp () << std::endl; |
115 } |
117 } |
116 exit (0); |
118 exit (0); |
117 } |
119 } |
118 |
120 |
126 } |
128 } |
127 for (uint32_t i = 0; i < tid.GetAttributeN (); ++i) |
129 for (uint32_t i = 0; i < tid.GetAttributeN (); ++i) |
128 { |
130 { |
129 std::cout << " --"<<tid.GetAttributeFullName (i)<<"=["; |
131 std::cout << " --"<<tid.GetAttributeFullName (i)<<"=["; |
130 Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (i); |
132 Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (i); |
131 Attribute initial = tid.GetAttributeInitialValue (i); |
133 Ptr<const AttributeValue> initial = tid.GetAttributeInitialValue (i); |
132 std::cout << initial.SerializeToString (checker) << "]: " |
134 std::cout << initial->SerializeToString (checker) << "]: " |
133 << tid.GetAttributeHelp (i) << std::endl; |
135 << tid.GetAttributeHelp (i) << std::endl; |
134 } |
136 } |
135 exit (0); |
137 exit (0); |
136 } |
138 } |
137 |
139 |
241 { |
243 { |
242 return; |
244 return; |
243 } |
245 } |
244 } |
246 } |
245 } |
247 } |
246 if (!Config::SetGlobalFailSafe (name, String (value)) |
248 if (!Config::SetGlobalFailSafe (name, StringValue (value)) |
247 && !Config::SetDefaultFailSafe (name, String (value))) |
249 && !Config::SetDefaultFailSafe (name, StringValue (value))) |
248 { |
250 { |
249 std::cerr << "Invalid command-line arguments: --"<<name<<"="<<value<<std::endl; |
251 std::cerr << "Invalid command-line arguments: --"<<name<<"="<<value<<std::endl; |
250 PrintHelp (); |
252 PrintHelp (); |
251 } |
253 } |
252 } |
254 } |