}
void FlagArg::render(const ArgList &Args, ArgStringList &Output) const {
- assert(0 && "FIXME: Implement");
+ Output.push_back(Args.getArgString(getIndex()));
}
const char *FlagArg::getValue(const ArgList &Args, unsigned N) const {
}
void PositionalArg::render(const ArgList &Args, ArgStringList &Output) const {
- assert(0 && "FIXME: Implement");
+ Output.push_back(Args.getArgString(getIndex()));
}
const char *PositionalArg::getValue(const ArgList &Args, unsigned N) const {
}
void JoinedArg::render(const ArgList &Args, ArgStringList &Output) const {
- assert(0 && "FIXME: Implement");
+ if (getOption().hasForceSeparateRender()) {
+ Output.push_back(getOption().getName());
+ Output.push_back(getValue(Args, 0));
+ } else {
+ Output.push_back(Args.getArgString(getIndex()));
+ }
}
const char *JoinedArg::getValue(const ArgList &Args, unsigned N) const {
}
void CommaJoinedArg::render(const ArgList &Args, ArgStringList &Output) const {
- assert(0 && "FIXME: Implement");
+ Output.push_back(Args.getArgString(getIndex()));
}
const char *CommaJoinedArg::getValue(const ArgList &Args, unsigned N) const {
}
void SeparateArg::render(const ArgList &Args, ArgStringList &Output) const {
- assert(0 && "FIXME: Implement");
+ if (getOption().hasForceJoinedRender()) {
+ assert(getNumValues() == 1 && "Cannot force joined render with > 1 args.");
+ // FIXME: Avoid std::string.
+ std::string Joined(getOption().getName());
+ Joined += Args.getArgString(getIndex());
+ Output.push_back(Args.MakeArgString(Joined.c_str()));
+ } else {
+ Output.push_back(Args.getArgString(getIndex()));
+ for (unsigned i = 0; i < NumValues; ++i)
+ Output.push_back(Args.getArgString(getIndex() + 1 + i));
+ }
}
const char *SeparateArg::getValue(const ArgList &Args, unsigned N) const {
void JoinedAndSeparateArg::render(const ArgList &Args,
ArgStringList &Output) const {
- assert(0 && "FIXME: Implement");
+ Output.push_back(Args.getArgString(getIndex()));
+ Output.push_back(Args.getArgString(getIndex()) + 1);
}
const char *JoinedAndSeparateArg::getValue(const ArgList &Args,