fix --help message

This commit is contained in:
David Renshaw 2014-05-28 21:12:03 -04:00
parent 245ff0b15d
commit da8d0d1f56
2 changed files with 18 additions and 5 deletions

View file

@ -179,11 +179,10 @@ public:
CapnpcJavaMain(kj::ProcessContext& context): context(context) {}
kj::MainFunc getMain() {
return kj::MainBuilder(context, "Cap'n Proto loopback plugin version " VERSION,
"This is a Cap'n Proto compiler plugin which \"de-compiles\" the schema back into "
"Cap'n Proto schema language format, with comments showing the offsets chosen by the "
"compiler. This is meant to be run using the Cap'n Proto compiler, e.g.:\n"
" capnp compile -ocapnp foo.capnp")
return kj::MainBuilder(context, "Cap'n Proto Java plugin version " VERSION,
"This is a Cap'n Proto compiler plugin which generates Java code."
" This is meant to be run using the Cap'n Proto compiler, e.g.:\n"
" capnp compile -ojava foo.capnp")
.callAfterParsing(KJ_BIND_METHOD(*this, run))
.build();
}
@ -1006,6 +1005,11 @@ private:
case schema::Type::UINT64:
case schema::Type::FLOAT32:
case schema::Type::FLOAT64:
builderFactoryType = kj::str("ord.capnproto.PrimitiveElementFactory.",
toUpperCase(kj::str(typeName(typeBody.getList().getElementType()))));
readerFactoryType = kj::str(builderFactoryType);
primitiveElement = true;
break;
case schema::Type::ENUM:
primitiveElement = true;
break;

View file

@ -4,6 +4,7 @@ public interface PrimitiveElementFactory<T> {
public T get(ListReader listReader, int index);
public static final PrimitiveElementFactory<Void> VOID = new PrimitiveElementFactoryVoid();
// public static final PrimitiveElementFactory<boolean> BOOLEAN = new PrimitiveElementFactoryBoolean();
}
@ -13,3 +14,11 @@ class PrimitiveElementFactoryVoid implements PrimitiveElementFactory<Void> {
}
}
/*
argh, generics must be boxed.
class PrimitiveElementFactoryBoolean implements PrimitiveElementFactory<boolean> {
public boolean get(ListReader listReader, int index) {
throw new Error("unimplemented");
}
}
*/