From e34b13367b02ac24611055af1cb96bc670afe92c Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr." Date: Mon, 18 Aug 2014 16:00:42 -0700 Subject: [PATCH] Show default attribute value in command line example - cleanup --- src/core/examples/command-line-example.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/core/examples/command-line-example.cc b/src/core/examples/command-line-example.cc index f6bb3cd19..80e32cd57 100644 --- a/src/core/examples/command-line-example.cc +++ b/src/core/examples/command-line-example.cc @@ -60,7 +60,7 @@ int main (int argc, char *argv[]) { struct TypeId::AttributeInformation info; tid.LookupAttributeByName (attrName, &info); - attrDef = info.initialValue->SerializeToString (info.checker); + attrDef = info.originalInitialValue->SerializeToString (info.checker); } @@ -90,18 +90,9 @@ int main (int argc, char *argv[]) std::cout << std::setw (10) << "strArg:" << "\"" << strDef << "\"" << std::endl; - - // Look up new default value for attribute - { - struct TypeId::AttributeInformation info; - tid.LookupAttributeByName (attrName, &info); - - std::cout << std::setw (10) << "anti:" - << "\"" - << info.originalInitialValue->SerializeToString (info.checker) - << "\"" - << std::endl; - } + std::cout << std::setw (10) << "anti:" + << "\"" << attrDef << "\"" + << std::endl; std::cout << std::setw (10) << "cbArg:" << "\"" << cbDef << "\"" << std::endl; @@ -109,6 +100,7 @@ int main (int argc, char *argv[]) // Show final values + std::cout << "Final values:" << std::endl; std::cout << std::left << std::setw (10) << "intArg:" << intArg << std::endl;