- buf += " { \"#{key}\"\n" +
- " , \"#{arguments(command)}\"\n" +
- " , \"#{command['summary']}\"\n" +
- " , COMMAND_GROUP_#{command['group'].upcase}\n" +
- " , \"#{command['since']}\" }"
- end.join("\n")
- puts "\n// Auto-generated, do not edit.\n" + tmpl.sub('__COMMANDS__', c)
-else
- res.error!
-end
\ No newline at end of file
+
+ ret = <<-SPEC
+{ "#{key}",
+ "#{arguments(command)}",
+ "#{command["summary"]}",
+ #{group},
+ "#{command["since"]}" }
+ SPEC
+ ret.strip
+ end.join(",\n ")
+end
+
+# Write to stdout
+puts <<-HELP_H
+/* Automatically generated by #{__FILE__}, do not edit. */
+
+#ifndef __REDIS_HELP_H
+#define __REDIS_HELP_H
+
+static char *commandGroups[] = {
+ #{generate_groups}
+};
+
+struct commandHelp {
+ char *name;
+ char *params;
+ char *summary;
+ int group;
+ char *since;
+} commandHelp[] = {
+ #{generate_commands}
+};
+
+#endif
+HELP_H
+