mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-16 16:11:42 -04:00
Pass arguments to the programs
This commit is contained in:
parent
e290a761c1
commit
8d6e26a41a
@ -96,7 +96,15 @@ int main(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!found){
|
if(!found){
|
||||||
auto result = exec_and_wait(params[0].c_str());
|
std::vector<std::string> args;
|
||||||
|
if(params.size() > 1){
|
||||||
|
args.reserve(params.size() - 1);
|
||||||
|
for(size_t i = 1; i < params.size(); ++i){
|
||||||
|
args.push_back(params[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto result = exec_and_wait(params[0].c_str(), args);
|
||||||
|
|
||||||
if(!result.valid()){
|
if(!result.valid()){
|
||||||
print("error: ");
|
print("error: ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user