00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "ConsoleCommand.h"
00018 #include <netinet/in.h>
00019
00020 namespace oasys {
00021
00022 ConsoleCommand::ConsoleCommand(const char* default_prompt)
00023 : TclCommand("console"),
00024 stdio_(true),
00025 addr_(htonl(INADDR_LOOPBACK)),
00026 port_(0),
00027 prompt_(default_prompt)
00028 {
00029 bind_var(new BoolOpt("stdio", &stdio_, "spawn interpreter on stdin/stdout"));
00030 bind_var(new InAddrOpt("addr", &addr_, "addr", "console listening address"));
00031 bind_var(new UInt16Opt("port", &port_, "port", "console listening port (default 0)"));
00032 bind_var(new StringOpt("prompt", &prompt_, "prompt", "console prompt string"));
00033 }
00034
00035 }