240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
fossil_exit(1);
}else{
g.fQuiet = find_option("quiet", 0, 0)!=0;
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
g.zLogin = find_option("user", "U", 1);
zCmdName = argv[1];
}
rc = name_search(zCmdName, aCommand, count(aCommand), &idx);
if( rc==1 ){
fprintf(stderr,"%s: unknown command: %s\n"
"%s: use \"help\" for more information\n",
argv[0], zCmdName, argv[0]);
fossil_exit(1);
|
>
>
>
>
>
>
>
>
>
>
>
>
|
|
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
fossil_exit(1);
}else{
g.fQuiet = find_option("quiet", 0, 0)!=0;
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
g.zLogin = find_option("user", "U", 1);
if( find_option("help",0,0)!=0 ){
/* --help anywhere on the command line is translated into
** "fossil help argv[1] argv[2]..." */
int i;
char **zNewArgv = fossil_malloc( sizeof(char*)*(g.argc+2) );
for(i=1; i<g.argc; i++) zNewArgv[i+1] = argv[i];
zNewArgv[i+1] = 0;
zNewArgv[0] = argv[0];
zNewArgv[1] = "help";
g.argc++;
g.argv = zNewArgv;
}
zCmdName = g.argv[1];
}
rc = name_search(zCmdName, aCommand, count(aCommand), &idx);
if( rc==1 ){
fprintf(stderr,"%s: unknown command: %s\n"
"%s: use \"help\" for more information\n",
argv[0], zCmdName, argv[0]);
fossil_exit(1);
|
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
|
*/
const char *find_option(const char *zLong, const char *zShort, int hasArg){
int i;
int nLong;
const char *zReturn = 0;
assert( hasArg==0 || hasArg==1 );
nLong = strlen(zLong);
for(i=2; i<g.argc; i++){
char *z;
if (i+hasArg >= g.argc) break;
z = g.argv[i];
if( z[0]!='-' ) continue;
z++;
if( z[0]=='-' ){
if( z[1]==0 ){
|
|
|
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
|
*/
const char *find_option(const char *zLong, const char *zShort, int hasArg){
int i;
int nLong;
const char *zReturn = 0;
assert( hasArg==0 || hasArg==1 );
nLong = strlen(zLong);
for(i=1; i<g.argc; i++){
char *z;
if (i+hasArg >= g.argc) break;
z = g.argv[i];
if( z[0]!='-' ) continue;
z++;
if( z[0]=='-' ){
if( z[1]==0 ){
|