mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Make ... optional in .args (#1086)
This commit is contained in:
parent
6db1200a7e
commit
08793aa143
2 changed files with 21 additions and 7 deletions
|
@ -91,6 +91,15 @@ int LoadZipArgsImpl(int *argc, char ***argv, char *data) {
|
|||
}
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (!founddots)
|
||||
{
|
||||
founddots = true;
|
||||
for (i = 1; i < *argc; ++i) {
|
||||
AddZipArg(&n, &args, (*argv)[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (founddots || *argc <= 1) {
|
||||
if (!g_zipargs.initialized) {
|
||||
atexit(FreeZipArgs);
|
||||
|
@ -118,8 +127,9 @@ int LoadZipArgsImpl(int *argc, char ***argv, char *data) {
|
|||
*
|
||||
* Your `.args` file should have one argument per line.
|
||||
*
|
||||
* If the special argument `...` is *not* encountered, then the
|
||||
* replacement will only happen if *no* CLI args are specified.
|
||||
* If the special argument `...` is *not* encountered, then it would be assumed
|
||||
* that the developer intent is for whatever CLI args were specified by the user
|
||||
* to be appended to the end
|
||||
*
|
||||
* If the special argument `...` *is* encountered, then it'll be
|
||||
* replaced with whatever CLI args were specified by the user.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue