aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Framework/Console/ConsoleBase.cs29
1 files changed, 26 insertions, 3 deletions
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index f9dfb63..75dbe11 100755
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -121,17 +121,38 @@ namespace OpenSim.Framework.Console
121 121
122 public string Prompt(string p) 122 public string Prompt(string p)
123 { 123 {
124 return Prompt(p, null, null, true); 124 return ReadLine(String.Format("{0}: ", p), false, true);
125 } 125 }
126 126
127 public string Prompt(string p, string def) 127 public string Prompt(string p, string def)
128 { 128 {
129 return Prompt(p, def, null, true); 129 string ret = ReadLine(String.Format("{0} [{1}]: ", p, def), false, true);
130 if (ret == String.Empty)
131 ret = def;
132
133 return ret;
130 } 134 }
131 135
132 public string Prompt(string p, List<char> excludedCharacters) 136 public string Prompt(string p, List<char> excludedCharacters)
133 { 137 {
134 return Prompt(p, null, excludedCharacters, true); 138 bool itisdone = false;
139 string ret = String.Empty;
140 while (!itisdone)
141 {
142 itisdone = true;
143 ret = Prompt(p);
144
145 foreach (char c in excludedCharacters)
146 {
147 if (ret.Contains(c.ToString()))
148 {
149 System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted.");
150 itisdone = false;
151 }
152 }
153 }
154
155 return ret;
135 } 156 }
136 157
137 public virtual string Prompt(string p, string def, List<char> excludedCharacters, bool echo = true) 158 public virtual string Prompt(string p, string def, List<char> excludedCharacters, bool echo = true)
@@ -142,6 +163,8 @@ namespace OpenSim.Framework.Console
142 { 163 {
143 itisdone = true; 164 itisdone = true;
144 165
166 ret = Prompt(p, def);
167
145 if (def != null) 168 if (def != null)
146 ret = ReadLine(String.Format("{0}: ", p), false, echo); 169 ret = ReadLine(String.Format("{0}: ", p), false, echo);
147 else 170 else