Fossil SCM
Fixed inconsistent calls to usage() in the attachment command which result in printing the fossil command name twice in the Usage: message.
rberteig
2016-03-24 18:28
Commit
420a5fc0bf0d3b5c39aea72ccad852f64d135113
Parent
c29c75c938f9c00…
1 file changed
+3
-3
+3
-3
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -714,11 +714,11 @@ | ||
| 714 | 714 | const char *zTarget; /* Target of the attachment */ |
| 715 | 715 | Blob content; /* The content of the attachment */ |
| 716 | 716 | zETime = find_option("technote","t",1); |
| 717 | 717 | if( !zETime ){ |
| 718 | 718 | if( g.argc!=5 ){ |
| 719 | - usage("attachment add PAGENAME FILENAME"); | |
| 719 | + usage("add PAGENAME FILENAME"); | |
| 720 | 720 | } |
| 721 | 721 | zPageName = g.argv[3]; |
| 722 | 722 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 723 | 723 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 724 | 724 | " ORDER BY x.mtime DESC LIMIT 1", |
| @@ -732,11 +732,11 @@ | ||
| 732 | 732 | } |
| 733 | 733 | zTarget = zPageName; |
| 734 | 734 | zFile = g.argv[4]; |
| 735 | 735 | }else{ |
| 736 | 736 | if( g.argc!=4 ){ |
| 737 | - usage("attachment add FILENAME --technote DATETIME"); | |
| 737 | + usage("add FILENAME --technote DATETIME"); | |
| 738 | 738 | } |
| 739 | 739 | rid = db_int(0, "SELECT objid FROM event" |
| 740 | 740 | " WHERE datetime(mtime)=datetime('%q') AND type='e'" |
| 741 | 741 | " ORDER BY mtime DESC LIMIT 1", |
| 742 | 742 | zETime |
| @@ -772,7 +772,7 @@ | ||
| 772 | 772 | goto attachment_cmd_usage; |
| 773 | 773 | } |
| 774 | 774 | return; |
| 775 | 775 | |
| 776 | 776 | attachment_cmd_usage: |
| 777 | - usage("attachment add ?PAGENAME? FILENAME [-t|--technote DATETIME ]"); | |
| 777 | + usage("add ?PAGENAME? FILENAME [-t|--technote DATETIME ]"); | |
| 778 | 778 | } |
| 779 | 779 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -714,11 +714,11 @@ | |
| 714 | const char *zTarget; /* Target of the attachment */ |
| 715 | Blob content; /* The content of the attachment */ |
| 716 | zETime = find_option("technote","t",1); |
| 717 | if( !zETime ){ |
| 718 | if( g.argc!=5 ){ |
| 719 | usage("attachment add PAGENAME FILENAME"); |
| 720 | } |
| 721 | zPageName = g.argv[3]; |
| 722 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 723 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 724 | " ORDER BY x.mtime DESC LIMIT 1", |
| @@ -732,11 +732,11 @@ | |
| 732 | } |
| 733 | zTarget = zPageName; |
| 734 | zFile = g.argv[4]; |
| 735 | }else{ |
| 736 | if( g.argc!=4 ){ |
| 737 | usage("attachment add FILENAME --technote DATETIME"); |
| 738 | } |
| 739 | rid = db_int(0, "SELECT objid FROM event" |
| 740 | " WHERE datetime(mtime)=datetime('%q') AND type='e'" |
| 741 | " ORDER BY mtime DESC LIMIT 1", |
| 742 | zETime |
| @@ -772,7 +772,7 @@ | |
| 772 | goto attachment_cmd_usage; |
| 773 | } |
| 774 | return; |
| 775 | |
| 776 | attachment_cmd_usage: |
| 777 | usage("attachment add ?PAGENAME? FILENAME [-t|--technote DATETIME ]"); |
| 778 | } |
| 779 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -714,11 +714,11 @@ | |
| 714 | const char *zTarget; /* Target of the attachment */ |
| 715 | Blob content; /* The content of the attachment */ |
| 716 | zETime = find_option("technote","t",1); |
| 717 | if( !zETime ){ |
| 718 | if( g.argc!=5 ){ |
| 719 | usage("add PAGENAME FILENAME"); |
| 720 | } |
| 721 | zPageName = g.argv[3]; |
| 722 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 723 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 724 | " ORDER BY x.mtime DESC LIMIT 1", |
| @@ -732,11 +732,11 @@ | |
| 732 | } |
| 733 | zTarget = zPageName; |
| 734 | zFile = g.argv[4]; |
| 735 | }else{ |
| 736 | if( g.argc!=4 ){ |
| 737 | usage("add FILENAME --technote DATETIME"); |
| 738 | } |
| 739 | rid = db_int(0, "SELECT objid FROM event" |
| 740 | " WHERE datetime(mtime)=datetime('%q') AND type='e'" |
| 741 | " ORDER BY mtime DESC LIMIT 1", |
| 742 | zETime |
| @@ -772,7 +772,7 @@ | |
| 772 | goto attachment_cmd_usage; |
| 773 | } |
| 774 | return; |
| 775 | |
| 776 | attachment_cmd_usage: |
| 777 | usage("add ?PAGENAME? FILENAME [-t|--technote DATETIME ]"); |
| 778 | } |
| 779 |