aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/ConsoleBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Framework/Console/ConsoleBase.cs60
1 files changed, 58 insertions, 2 deletions
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index b70d1db..4b375d9 100755
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Console
41 41
42 protected string prompt = "# "; 42 protected string prompt = "# ";
43 43
44 public object ConsoleScene = null; 44 public object ConsoleScene { get; set; }
45 45
46 /// <summary> 46 /// <summary>
47 /// The default prompt text. 47 /// The default prompt text.
@@ -75,6 +75,11 @@ namespace OpenSim.Framework.Console
75 { 75 {
76 System.Console.WriteLine(text); 76 System.Console.WriteLine(text);
77 } 77 }
78
79 public virtual void OutputFormat(string format, params object[] components)
80 {
81 Output(string.Format(format, components));
82 }
78 83
79 public string CmdPrompt(string p) 84 public string CmdPrompt(string p)
80 { 85 {
@@ -89,6 +94,57 @@ namespace OpenSim.Framework.Console
89 94
90 return ret; 95 return ret;
91 } 96 }
97
98 public string CmdPrompt(string p, List<char> excludedCharacters)
99 {
100 bool itisdone = false;
101 string ret = String.Empty;
102 while (!itisdone)
103 {
104 itisdone = true;
105 ret = CmdPrompt(p);
106
107 foreach (char c in excludedCharacters)
108 {
109 if (ret.Contains(c.ToString()))
110 {
111 System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted.");
112 itisdone = false;
113 }
114 }
115 }
116
117 return ret;
118 }
119
120 public string CmdPrompt(string p, string def, List<char> excludedCharacters)
121 {
122 bool itisdone = false;
123 string ret = String.Empty;
124 while (!itisdone)
125 {
126 itisdone = true;
127 ret = CmdPrompt(p, def);
128
129 if (ret == String.Empty)
130 {
131 ret = def;
132 }
133 else
134 {
135 foreach (char c in excludedCharacters)
136 {
137 if (ret.Contains(c.ToString()))
138 {
139 System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted.");
140 itisdone = false;
141 }
142 }
143 }
144 }
145
146 return ret;
147 }
92 148
93 // Displays a command prompt and returns a default value, user may only enter 1 of 2 options 149 // Displays a command prompt and returns a default value, user may only enter 1 of 2 options
94 public string CmdPrompt(string prompt, string defaultresponse, List<string> options) 150 public string CmdPrompt(string prompt, string defaultresponse, List<string> options)
@@ -118,7 +174,7 @@ namespace OpenSim.Framework.Console
118 // (Done with no echo and suitable for passwords) 174 // (Done with no echo and suitable for passwords)
119 public string PasswdPrompt(string p) 175 public string PasswdPrompt(string p)
120 { 176 {
121 return ReadLine(p, false, false); 177 return ReadLine(String.Format("{0}: ", p), false, false);
122 } 178 }
123 179
124 public virtual string ReadLine(string p, bool isCommand, bool e) 180 public virtual string ReadLine(string p, bool isCommand, bool e)