mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Add /.args
feature to Redbean/Lua/SQLite/Python/QuickJS
You now have some ability to truly make an executable yours, by adding a `.args` file to the root of the zip structure. If this is specified, then you'll be overriding the default CLI args. This will be a great feature for folks who want to distribute their own apps, using the interpreter executable, but have the executable appears to be just your app rather than being the interpreter.
This commit is contained in:
parent
0f6251f4d2
commit
4499f98e76
19 changed files with 421 additions and 19 deletions
12
third_party/sqlite3/shell.c
vendored
12
third_party/sqlite3/shell.c
vendored
|
@ -92,6 +92,8 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/stat.macros.h"
|
||||
#include "tool/args/args.h"
|
||||
#include "tool/args/args.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
typedef sqlite3_int64 i64;
|
||||
|
@ -20563,12 +20565,7 @@ static char *cmdline_option_value(int argc, char **argv, int i){
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if SQLITE_SHELL_IS_UTF8
|
||||
int SQLITE_CDECL main(int argc, char **argv){
|
||||
#else
|
||||
int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
char **argv;
|
||||
#endif
|
||||
char *zErrMsg = 0;
|
||||
ShellState data;
|
||||
const char *zInitFile = 0;
|
||||
|
@ -20579,11 +20576,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
|||
int nCmd = 0;
|
||||
char **azCmd = 0;
|
||||
const char *zVfs = 0; /* Value of -vfs command-line option */
|
||||
#if !SQLITE_SHELL_IS_UTF8
|
||||
char **argvToFree = 0;
|
||||
int argcToFree = 0;
|
||||
#endif
|
||||
|
||||
LoadZipArgs(&argc, &argv);
|
||||
setBinaryMode(stdin, 0);
|
||||
setvbuf(stderr, 0, _IONBF, 0); /* Make sure stderr is unbuffered */
|
||||
setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue