Skip to content

Commit 8401b8b

Browse files
Make protocol non-configurable in ApiGen
1 parent 093442d commit 8401b8b

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

projects/client/Apigen/src/apigen/Apigen.cs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public static string MangleMethodClass(AmqpClass c, AmqpMethod m) {
165165
public XmlDocument m_spec = null;
166166
public TextWriter m_outputFile = null;
167167

168-
public bool m_versionOverridden = false;
169168
public int m_majorVersion;
170169
public int m_minorVersion;
171170
public int m_revision = 0;
@@ -209,11 +208,6 @@ public void HandleOption(string opt) {
209208
m_framingSubnamespace = opt.Substring(3);
210209
} else if (opt.StartsWith("/apiName:")) {
211210
m_apiName = opt.Substring(9);
212-
} else if (opt.StartsWith("/v:")) {
213-
string[] parts = opt.Substring(3).Split(new char[] { '-' });
214-
m_versionOverridden = true;
215-
m_majorVersion = int.Parse(parts[0]);
216-
m_minorVersion = int.Parse(parts[1]);
217211
} else if (opt == "/c") {
218212
m_emitComments = true;
219213
} else {
@@ -227,7 +221,6 @@ public void Usage() {
227221
Console.Error.WriteLine(" Options include:");
228222
Console.Error.WriteLine(" /apiName:<identifier>");
229223
Console.Error.WriteLine(" /n:<name.space.prefix>");
230-
Console.Error.WriteLine(" /v:<majorversion>-<minorversion>");
231224
Console.Error.WriteLine(" The apiName option is required.");
232225
Environment.Exit(1);
233226
}
@@ -285,15 +278,11 @@ public void LoadSpec() {
285278
}
286279

287280
public void ParseSpec() {
288-
Console.WriteLine("* Parsing spec");
289-
if (!m_versionOverridden) {
290-
m_majorVersion = GetInt(m_spec, "/amqp/@major");
291-
m_minorVersion = GetInt(m_spec, "/amqp/@minor");
292-
if (m_spec.SelectSingleNode("/amqp/@revision") != null)
293-
{
294-
m_revision = GetInt(m_spec, "/amqp/@revision");
295-
}
296-
}
281+
m_majorVersion = GetInt(m_spec, "/amqp/@major");
282+
m_minorVersion = GetInt(m_spec, "/amqp/@minor");
283+
m_revision = GetInt(m_spec, "/amqp/@revision");
284+
285+
Console.WriteLine("* Parsing spec for version {0}.{1}.{2}", m_majorVersion, m_minorVersion, m_revision);
297286
foreach (XmlNode n in m_spec.SelectNodes("/amqp/constant")) {
298287
m_constants.Add(new KeyValuePair<string, int>(GetString(n, "@name"), GetInt(n, "@value")));
299288
}

0 commit comments

Comments
 (0)