improve the duprule command
parent
077460f53c
commit
b3bf83dfc5
10
main.cc
10
main.cc
|
@ -339,8 +339,7 @@ struct ObState {
|
||||||
r.target = tgt;
|
r.target = tgt;
|
||||||
r.action = oldr->action;
|
r.action = oldr->action;
|
||||||
r.func = oldr->func;
|
r.func = oldr->func;
|
||||||
r.deps = dep ? cscript::util::list_explode(dep)
|
r.deps = dep ? cscript::util::list_explode(dep) : oldr->deps;
|
||||||
: ostd::Vector<ostd::String>();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -442,9 +441,10 @@ int main(int argc, char **argv) {
|
||||||
((ObState &)cs).rule_add(file, deps, nullptr);
|
((ObState &)cs).rule_add(file, deps, nullptr);
|
||||||
});
|
});
|
||||||
|
|
||||||
os.cs.add_command("duprule", "sss", [](CsState &cs, const char *tgt,
|
os.cs.add_command("duprule", "sssN", [](CsState &cs, const char *tgt,
|
||||||
const char *ptgt, const char *dep) {
|
const char *ptgt, const char *dep,
|
||||||
((ObState &)cs).rule_dup(tgt, ptgt, dep);
|
int *numargs) {
|
||||||
|
((ObState &)cs).rule_dup(tgt, ptgt, (*numargs > 2) ? dep : nullptr);
|
||||||
});
|
});
|
||||||
|
|
||||||
os.cs.add_commandn("getenv", "ss", [](CsState &cs, TvalRange args) {
|
os.cs.add_commandn("getenv", "ss", [](CsState &cs, TvalRange args) {
|
||||||
|
|
Loading…
Reference in New Issue