Don't allow unexpected arguments.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3670 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
786c83c57c
commit
b1a6384ac1
12
src/main.c
12
src/main.c
@ -139,7 +139,7 @@ static int _tf_command_test(const char* file, int argc, char* argv[])
|
|||||||
const char** extras = NULL;
|
const char** extras = NULL;
|
||||||
int extra_count = 0;
|
int extra_count = 0;
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "test [options]", "options:", NULL, 15);
|
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "test [options]", "options:", NULL, 15);
|
||||||
if (extras)
|
if (extras)
|
||||||
{
|
{
|
||||||
free((void*)extras);
|
free((void*)extras);
|
||||||
@ -184,7 +184,7 @@ static int _tf_command_import(const char* file, int argc, char* argv[])
|
|||||||
const char** extras = NULL;
|
const char** extras = NULL;
|
||||||
int extra_count = 0;
|
int extra_count = 0;
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "import [options] [paths] ...", "options:", NULL, 15);
|
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "import [options] [paths] ...", "options:", NULL, 15);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
@ -250,7 +250,7 @@ static int _tf_command_export(const char* file, int argc, char* argv[])
|
|||||||
const char** extras = NULL;
|
const char** extras = NULL;
|
||||||
int extra_count = 0;
|
int extra_count = 0;
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "export [options] [paths] ...", "options:", NULL, 15);
|
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "export [options] [paths] ...", "options:", NULL, 15);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
@ -330,7 +330,7 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
|
|||||||
const char** extras = NULL;
|
const char** extras = NULL;
|
||||||
int extra_count = 0;
|
int extra_count = 0;
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "run [options] [paths] ...", "options:", NULL, 15);
|
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "run [options] [paths] ...", "options:", NULL, 15);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
@ -394,7 +394,7 @@ static int _tf_command_sandbox(const char* file, int argc, char* argv[])
|
|||||||
const char** extras = NULL;
|
const char** extras = NULL;
|
||||||
int extra_count = 0;
|
int extra_count = 0;
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "sandbox [options]", "options:", NULL, 15);
|
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_POSIXMEHARDER | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "sandbox [options]", "options:", NULL, 15);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
@ -446,7 +446,7 @@ static int _tf_command_post(const char* file, int argc, char* argv[])
|
|||||||
const char** extras = NULL;
|
const char** extras = NULL;
|
||||||
int extra_count = 0;
|
int extra_count = 0;
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "post [options]", "options:", NULL, 15);
|
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "post [options]", "options:", NULL, 15);
|
||||||
if (extras)
|
if (extras)
|
||||||
{
|
{
|
||||||
free((void*)extras);
|
free((void*)extras);
|
||||||
|
Loading…
Reference in New Issue
Block a user