return result == 0;
}
+//=======================================================================
+//function : GetHelp
+//purpose :
+//=======================================================================
+
+Standard_CString Draw_Interpretor::GetHelp (Standard_CString theCommandName) const
+{
+ return Tcl_GetVar2 (myInterp, "Draw_Helps", theCommandName, TCL_GLOBAL_ONLY);
+}
+
+//=======================================================================
+//function : ErrorOnWrongArgs
+//purpose :
+//=======================================================================
+
+Standard_Integer Draw_Interpretor::ErrorOnWrongArgs (Standard_CString theCommandName) const
+{
+ std::cerr << "Error: wrong number of arguments" << std::endl;
+
+ Standard_CString aHelp = GetHelp (theCommandName);
+ if (aHelp)
+ {
+ std::cerr << "Use: " << theCommandName << " " << aHelp << std::endl;
+ }
+
+ return 1;
+}
+
//=======================================================================
//function : Result
//purpose :
//! Removes <theCommandName>, returns true if success (the command existed).
Standard_EXPORT Standard_Boolean Remove (const Standard_CString theCommandName);
+ //! Returns text of the help recorded for command theCommandName
+ //! (previously added by method Add() or by command "help" in Tcl interpretor).
+ //! Returns Null if no help string is defined for theCommandName.
+ Standard_EXPORT Standard_CString GetHelp (Standard_CString theCommandName) const;
+
+ //! Prints (to std::cerr) standard error message for theCommandName called with
+ //! wrong number of arguments. The message includes help for this command.
+ //! Returns 1 indicating error status for Tcl command.
+ Standard_EXPORT Standard_Integer ErrorOnWrongArgs (Standard_CString theCommandName) const;
+
public:
Standard_EXPORT Standard_CString Result() const;