Make curl example into a complete tool (#706)

You can now handily use `curl` with popen()/system() by
placing `STATIC_YOINK("_curl")` in your main source file.
This commit is contained in:
Ronsor 2022-12-21 16:12:02 -08:00 committed by GitHub
parent dd04aeba1c
commit f6b3019796
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 96 additions and 4 deletions

View file

@ -38,6 +38,7 @@
#include "third_party/awk/cmd.h"
#include "third_party/sed/cmd.h"
#include "third_party/tr/cmd.h"
#include "tool/curl/cmd.h"
/**
* @fileoverview Cosmopolitan Command Interpreter
@ -417,6 +418,7 @@ static int TryBuiltin(void) {
if (_weaken(_tr) && !strcmp(args[0], "tr")) return Fake(_weaken(_tr));
if (_weaken(_sed) && !strcmp(args[0], "sed")) return Fake(_weaken(_sed));
if (_weaken(_awk) && !strcmp(args[0], "awk")) return Fake(_weaken(_awk));
if (_weaken(_curl) && !strcmp(args[0], "curl")) return Fake(_weaken(_curl));
return -1;
}