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
1 file changed +3 -3
+3 -3
--- src/attach.c
+++ src/attach.c
@@ -714,11 +714,11 @@
714714
const char *zTarget; /* Target of the attachment */
715715
Blob content; /* The content of the attachment */
716716
zETime = find_option("technote","t",1);
717717
if( !zETime ){
718718
if( g.argc!=5 ){
719
- usage("attachment add PAGENAME FILENAME");
719
+ usage("add PAGENAME FILENAME");
720720
}
721721
zPageName = g.argv[3];
722722
rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x"
723723
" WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
724724
" ORDER BY x.mtime DESC LIMIT 1",
@@ -732,11 +732,11 @@
732732
}
733733
zTarget = zPageName;
734734
zFile = g.argv[4];
735735
}else{
736736
if( g.argc!=4 ){
737
- usage("attachment add FILENAME --technote DATETIME");
737
+ usage("add FILENAME --technote DATETIME");
738738
}
739739
rid = db_int(0, "SELECT objid FROM event"
740740
" WHERE datetime(mtime)=datetime('%q') AND type='e'"
741741
" ORDER BY mtime DESC LIMIT 1",
742742
zETime
@@ -772,7 +772,7 @@
772772
goto attachment_cmd_usage;
773773
}
774774
return;
775775
776776
attachment_cmd_usage:
777
- usage("attachment add ?PAGENAME? FILENAME [-t|--technote DATETIME ]");
777
+ usage("add ?PAGENAME? FILENAME [-t|--technote DATETIME ]");
778778
}
779779
--- 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

Keyboard Shortcuts

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