Fossil SCM

For the 'tag find' command, move parsing of the -n|--limit option to the innermost scope, to avoid conflicts with the 'tag add' variant of the -n|--dryrun option

florian 2018-12-26 14:16 UTC cmd-options-amend
Commit 5d5252b8846012b321ab5ee7b43727b559270a40a438341cfa5d1d3a32954578
1 file changed +2 -2
+2 -2
--- src/tag.c
+++ src/tag.c
@@ -435,12 +435,10 @@
435435
void tag_cmd(void){
436436
int n;
437437
int fRaw = find_option("raw","",0)!=0;
438438
int fPropagate = find_option("propagate","",0)!=0;
439439
const char *zPrefix = fRaw ? "" : "sym-";
440
- const char *zFindLimit = find_option("limit","n",1);
441
- const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
442440
443441
db_find_and_open_repository(0, 0);
444442
if( g.argc<3 ){
445443
goto tag_cmd_usage;
446444
}
@@ -481,10 +479,12 @@
481479
db_end_transaction(0);
482480
}else
483481
484482
if( strncmp(g.argv[2],"find",n)==0 ){
485483
Stmt q;
484
+ const char *zFindLimit = find_option("limit","n",1);
485
+ const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
486486
const char *zType = find_option("type","t",1);
487487
Blob sql = empty_blob;
488488
if( zType==0 || zType[0]==0 ) zType = "*";
489489
if( g.argc!=4 ){
490490
usage("find ?--raw? ?-t|--type TYPE? ?-n|--limit #? TAGNAME");
491491
--- src/tag.c
+++ src/tag.c
@@ -435,12 +435,10 @@
435 void tag_cmd(void){
436 int n;
437 int fRaw = find_option("raw","",0)!=0;
438 int fPropagate = find_option("propagate","",0)!=0;
439 const char *zPrefix = fRaw ? "" : "sym-";
440 const char *zFindLimit = find_option("limit","n",1);
441 const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
442
443 db_find_and_open_repository(0, 0);
444 if( g.argc<3 ){
445 goto tag_cmd_usage;
446 }
@@ -481,10 +479,12 @@
481 db_end_transaction(0);
482 }else
483
484 if( strncmp(g.argv[2],"find",n)==0 ){
485 Stmt q;
 
 
486 const char *zType = find_option("type","t",1);
487 Blob sql = empty_blob;
488 if( zType==0 || zType[0]==0 ) zType = "*";
489 if( g.argc!=4 ){
490 usage("find ?--raw? ?-t|--type TYPE? ?-n|--limit #? TAGNAME");
491
--- src/tag.c
+++ src/tag.c
@@ -435,12 +435,10 @@
435 void tag_cmd(void){
436 int n;
437 int fRaw = find_option("raw","",0)!=0;
438 int fPropagate = find_option("propagate","",0)!=0;
439 const char *zPrefix = fRaw ? "" : "sym-";
 
 
440
441 db_find_and_open_repository(0, 0);
442 if( g.argc<3 ){
443 goto tag_cmd_usage;
444 }
@@ -481,10 +479,12 @@
479 db_end_transaction(0);
480 }else
481
482 if( strncmp(g.argv[2],"find",n)==0 ){
483 Stmt q;
484 const char *zFindLimit = find_option("limit","n",1);
485 const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000;
486 const char *zType = find_option("type","t",1);
487 Blob sql = empty_blob;
488 if( zType==0 || zType[0]==0 ) zType = "*";
489 if( g.argc!=4 ){
490 usage("find ?--raw? ?-t|--type TYPE? ?-n|--limit #? TAGNAME");
491

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button