mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Add glob and some finer tuning of documentation
This commit is contained in:
parent
799e24a87b
commit
d51409ccd9
77 changed files with 1321 additions and 736 deletions
|
@ -62,6 +62,7 @@
|
|||
|
||||
char *symbol_;
|
||||
char *outpath_;
|
||||
char *yoink_;
|
||||
|
||||
const size_t kMinCompressSize = 32;
|
||||
const char kNoCompressExts[][8] = {".gz", ".xz", ".jpg", ".png",
|
||||
|
@ -70,13 +71,14 @@ const char kNoCompressExts[][8] = {".gz", ".xz", ".jpg", ".png",
|
|||
|
||||
noreturn void PrintUsage(int rc, FILE *f) {
|
||||
fprintf(f, "%s%s%s\n", "Usage: ", program_invocation_name,
|
||||
" [-o FILE] [-s SYMBOL] [FILE...]\n");
|
||||
" [-o FILE] [-s SYMBOL] [-y YOINK] [FILE...]\n");
|
||||
exit(rc);
|
||||
}
|
||||
|
||||
void GetOpts(int *argc, char ***argv) {
|
||||
int opt;
|
||||
while ((opt = getopt(*argc, *argv, "?ho:s:")) != -1) {
|
||||
yoink_ = "__zip_start";
|
||||
while ((opt = getopt(*argc, *argv, "?ho:s:y:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'o':
|
||||
outpath_ = optarg;
|
||||
|
@ -84,6 +86,9 @@ void GetOpts(int *argc, char ***argv) {
|
|||
case 's':
|
||||
symbol_ = optarg;
|
||||
break;
|
||||
case 'y':
|
||||
yoink_ = optarg;
|
||||
break;
|
||||
case '?':
|
||||
case 'h':
|
||||
PrintUsage(EXIT_SUCCESS, stdout);
|
||||
|
@ -273,8 +278,7 @@ void PullEndOfCentralDirectoryIntoLinkage(struct ElfWriter *elf) {
|
|||
elfwriter_align(elf, 1, 0);
|
||||
elfwriter_startsection(elf, ".yoink", SHT_PROGBITS,
|
||||
SHF_ALLOC | SHF_EXECINSTR);
|
||||
elfwriter_yoink(elf, "__zip_start");
|
||||
elfwriter_yoink(elf, "__zip_end");
|
||||
elfwriter_yoink(elf, yoink_);
|
||||
elfwriter_finishsection(elf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue