Switch public headers to getopt_long() entirely

Cosmopolitan's getopt() is now redefined as __getopt().
This commit is contained in:
Justine Tunney 2023-07-02 19:57:43 -07:00
parent 0c630d95b5
commit fe044e22cc
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
137 changed files with 148 additions and 179 deletions

View file

@ -31,7 +31,7 @@
#include "libc/sysv/consts/msync.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/regex/regex.h"
STATIC_YOINK("strerror_wr");

View file

@ -35,7 +35,7 @@
#include "libc/tinymath/emodl.h"
#include "libc/x/xsigaction.h"
#include "third_party/gdtoa/gdtoa.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define INT int128_t
#define FLOAT long double

View file

@ -22,7 +22,7 @@
#include "libc/fmt/magnumstrs.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" OCTAL DST...\n\

View file

@ -64,7 +64,7 @@
#include "libc/sysv/consts/termios.h"
#include "libc/time/time.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define MANUAL \
"\

View file

@ -35,7 +35,7 @@
#include "libc/sysv/consts/ok.h"
#include "libc/sysv/consts/s.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/musl/ftw.h"
#define USAGE \

View file

@ -42,7 +42,7 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "libc/zip.internal.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
/**
* @fileoverview GCC Codegen Fixer-Upper.

View file

@ -26,7 +26,7 @@
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/ok.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/zlib/zlib.h"
#define USAGE \

View file

@ -24,7 +24,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [FLAGS] OPERAND..\n\

View file

@ -32,7 +32,7 @@
#include "libc/str/str.h"
#include "libc/str/tab.internal.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
/**
* @fileoverview LZ4 content embedder.

View file

@ -53,7 +53,7 @@
#include "libc/thread/wait0.internal.h"
#include "libc/time/time.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/build/lib/getargs.h"
/**

View file

@ -16,7 +16,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [-p] [-m MODE] DIR...\n\

View file

@ -31,7 +31,7 @@
#include "libc/sysv/consts/ok.h"
#include "libc/sysv/consts/s.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/musl/ftw.h"
#define USAGE \

View file

@ -24,7 +24,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/o.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
char buf[512];

View file

@ -39,7 +39,7 @@
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/xed/x86.h"
#include "tool/build/lib/getargs.h"

View file

@ -60,7 +60,7 @@
#include "libc/sysv/consts/sched.h"
#include "libc/sysv/errfuns.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
// MANUALLY TESTED BY RUNNING
//

View file

@ -38,7 +38,7 @@
#include "libc/x/xasprintf.h"
#include "libc/x/xgetline.h"
#include "third_party/dlmalloc/dlmalloc.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
/**
* @fileoverview Pythonic System Call Trace

View file

@ -28,7 +28,7 @@
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/errfuns.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE1 \
"NAME\n\

View file

@ -25,7 +25,7 @@
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/ok.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" FILE...\n\

View file

@ -56,7 +56,7 @@
#include "libc/x/x.h"
#include "libc/x/xasprintf.h"
#include "net/https/https.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/mbedtls/ssl.h"
#include "third_party/zlib/zlib.h"
#include "tool/build/lib/eztls.h"

View file

@ -25,7 +25,7 @@
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "libc/str/tab.internal.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/mbedtls/sha256.h"
#define PROG "sha256sum"

View file

@ -24,7 +24,7 @@
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/o.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
/**
* @fileoverview elf to symbol table file dump tool

View file

@ -32,7 +32,7 @@
#include "libc/sysv/consts/sig.h"
#include "libc/sysv/consts/termios.h"
#include "libc/sysv/consts/w.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define GETOPTS "o:"

View file

@ -24,7 +24,7 @@
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
"\

View file

@ -28,7 +28,7 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "libc/zip.internal.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
static int infd;
static int outfd;

View file

@ -38,7 +38,7 @@
#include "libc/time/time.h"
#include "libc/x/x.h"
#include "libc/zip.internal.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/build/lib/elfwriter.h"
#include "tool/build/lib/stripcomponents.h"

View file

@ -45,7 +45,7 @@
#include "net/http/url.h"
#include "net/https/https.h"
#include "net/https/sslcache.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/mbedtls/ctr_drbg.h"
#include "third_party/mbedtls/debug.h"
#include "third_party/mbedtls/error.h"

View file

@ -30,7 +30,7 @@
#include "libc/stdio/rand.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define UPDATE "January 28th, 2008"

View file

@ -27,7 +27,7 @@
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/fileno.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/zlib/zlib.h"
#include "tool/decode/lib/bitabuilder.h"

View file

@ -25,7 +25,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/decode/lib/bitabuilder.h"
static FILE *fin, *fout;

View file

@ -23,7 +23,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/xed/x86.h"
#include "tool/decode/lib/idname.h"
#include "tool/decode/lib/xederrors.h"

View file

@ -17,7 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/runtime/runtime.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/lambda/lib/blc.h"
#define USAGE \

View file

@ -21,7 +21,7 @@
#include "libc/runtime/runtime.h"
#include "libc/str/locale.h"
#include "libc/sysv/consts/rlimit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/lambda/lib/blc.h"
/**

View file

@ -23,7 +23,7 @@
#include "libc/stdio/stdio.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [-?h01] <lambda.txt >binary.txt\n\

View file

@ -23,7 +23,7 @@
#include "libc/stdio/stdio.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [-?h] <lambda.txt >binary.txt\n\

View file

@ -28,7 +28,7 @@
#include "libc/sysv/consts/prot.h"
#include "libc/sysv/consts/rlimit.h"
#include "libc/sysv/consts/sig.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/lambda/lib/blc.h"
#define USAGE \

View file

@ -112,7 +112,7 @@
#include "net/http/tokenbucket.h"
#include "net/http/url.h"
#include "net/https/https.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/lua/cosmo.h"
#include "third_party/lua/lauxlib.h"
#include "third_party/lua/lrepl.h"

View file

@ -49,7 +49,7 @@
#include "net/http/http.h"
#include "net/http/url.h"
#include "net/https/https.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/mbedtls/ctr_drbg.h"
#include "third_party/mbedtls/debug.h"
#include "third_party/mbedtls/error.h"

View file

@ -39,7 +39,7 @@
#include "libc/sysv/consts/prot.h"
#include "libc/sysv/consts/sig.h"
#include "libc/time/clockstonanos.internal.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/build/lib/case.h"
#include "tool/plinko/lib/char.h"
#include "tool/plinko/lib/error.h"

View file

@ -25,7 +25,7 @@
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/fileno.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
/**
* @fileoverview Bing: Binary Glyphs.

View file

@ -24,7 +24,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [FLAGS] [PATH|FLEXDEC...] [<<<FLEXDEC...\\n...]\n\

View file

@ -44,7 +44,7 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/stb/stb_image.h"
#include "third_party/stb/stb_image_resize.h"
#ifdef __x86_64__

View file

@ -24,7 +24,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
int column_;

View file

@ -33,7 +33,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/termios.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/stb/stb_truetype.h"
#define MAXCODE

View file

@ -35,7 +35,7 @@
#include "libc/sysv/consts/exit.h"
#include "libc/x/x.h"
#include "third_party/gdtoa/gdtoa.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "tool/viz/lib/formatstringtable.h"
typedef double (*round_f)(double);

View file

@ -29,7 +29,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/sig.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/stb/stb_truetype.h"
#define SQR(x) ((x) * (x))

View file

@ -21,7 +21,7 @@
#include "libc/stdio/stdio.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
static FILE *fi_, *fo_;
static char *inpath_, *outpath_;

View file

@ -67,7 +67,7 @@
#include "libc/sysv/consts/sig.h"
#include "libc/sysv/consts/termios.h"
#include "libc/time/time.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
/**
* @fileoverview Conway's Game of Life

View file

@ -41,7 +41,7 @@
#include "libc/sysv/consts/prot.h"
#include "libc/testlib/testlib.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/stb/stb_image.h"
#include "tool/viz/lib/bilinearscale.h"
#include "tool/viz/lib/graphic.h"

View file

@ -53,7 +53,7 @@
#include "libc/sysv/consts/sig.h"
#include "libc/sysv/consts/termios.h"
#include "libc/time/time.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [-hznmHNW] [-p PID] [PATH]\n\

View file

@ -25,7 +25,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [FLAGS] [PATH...]\n\

View file

@ -50,7 +50,7 @@
#include "libc/sysv/consts/prot.h"
#include "libc/sysv/consts/termios.h"
#include "libc/x/x.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/stb/stb_image.h"
#include "tool/viz/lib/graphic.h"

View file

@ -42,7 +42,7 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "libc/sysv/consts/termios.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/stb/stb_image.h"
#include "tool/viz/lib/graphic.h"

View file

@ -92,7 +92,7 @@
#include "libc/sysv/errfuns.h"
#include "libc/time/time.h"
#include "libc/x/xsigaction.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#include "third_party/stb/stb_image_resize.h"
#include "tool/viz/lib/graphic.h"
#include "tool/viz/lib/knobs.h"

View file

@ -26,7 +26,7 @@
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "libc/sysv/consts/fileno.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define kUsage \
"Usage:\n\

View file

@ -30,7 +30,7 @@
#include "libc/str/unicode.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define kOneTrueTabWidth 8

View file

@ -27,7 +27,7 @@
#include "libc/str/str.h"
#include "libc/sysv/consts/ex.h"
#include "libc/sysv/consts/exit.h"
#include "third_party/getopt/getopt.h"
#include "third_party/getopt/getopt.internal.h"
#define USAGE \
" [FLAGS] [PATH...]\n\