Fossil SCM

The "fossil chat send" command should throw an error if there are any unrecognized command-line options.

drh 2021-01-05 01:26 trunk
Commit 904a5a5612e004269dec81448ebe1c7a335ca3449a33a1a5cfcda0574ec48323
1 file changed +2
+2
--- src/chat.c
+++ src/chat.c
@@ -741,10 +741,11 @@
741741
);
742742
}
743743
if( g.argc==2 ){
744744
const char *zBrowser = fossil_web_browser();
745745
char *zCmd;
746
+ verify_all_options();
746747
if( zBrowser==0 ) return;
747748
#ifdef _WIN32
748749
zCmd = mprintf("%s %s/chat?cli &", zBrowser, zUrl);
749750
#else
750751
zCmd = mprintf("%s \"%s/chat?cli\" &", zBrowser, zUrl);
@@ -760,10 +761,11 @@
760761
char zBoundary[80];
761762
sqlite3_uint64 r[3];
762763
if( zFilename==0 && zMsg==0 ){
763764
fossil_fatal("must have --message or --file or both");
764765
}
766
+ verify_all_options();
765767
i = (int)strlen(g.url.path);
766768
while( i>0 && g.url.path[i-1]=='/' ) i--;
767769
g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
768770
blob_init(&up, 0, 0);
769771
blob_init(&down, 0, 0);
770772
--- src/chat.c
+++ src/chat.c
@@ -741,10 +741,11 @@
741 );
742 }
743 if( g.argc==2 ){
744 const char *zBrowser = fossil_web_browser();
745 char *zCmd;
 
746 if( zBrowser==0 ) return;
747 #ifdef _WIN32
748 zCmd = mprintf("%s %s/chat?cli &", zBrowser, zUrl);
749 #else
750 zCmd = mprintf("%s \"%s/chat?cli\" &", zBrowser, zUrl);
@@ -760,10 +761,11 @@
760 char zBoundary[80];
761 sqlite3_uint64 r[3];
762 if( zFilename==0 && zMsg==0 ){
763 fossil_fatal("must have --message or --file or both");
764 }
 
765 i = (int)strlen(g.url.path);
766 while( i>0 && g.url.path[i-1]=='/' ) i--;
767 g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
768 blob_init(&up, 0, 0);
769 blob_init(&down, 0, 0);
770
--- src/chat.c
+++ src/chat.c
@@ -741,10 +741,11 @@
741 );
742 }
743 if( g.argc==2 ){
744 const char *zBrowser = fossil_web_browser();
745 char *zCmd;
746 verify_all_options();
747 if( zBrowser==0 ) return;
748 #ifdef _WIN32
749 zCmd = mprintf("%s %s/chat?cli &", zBrowser, zUrl);
750 #else
751 zCmd = mprintf("%s \"%s/chat?cli\" &", zBrowser, zUrl);
@@ -760,10 +761,11 @@
761 char zBoundary[80];
762 sqlite3_uint64 r[3];
763 if( zFilename==0 && zMsg==0 ){
764 fossil_fatal("must have --message or --file or both");
765 }
766 verify_all_options();
767 i = (int)strlen(g.url.path);
768 while( i>0 && g.url.path[i-1]=='/' ) i--;
769 g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
770 blob_init(&up, 0, 0);
771 blob_init(&down, 0, 0);
772

Keyboard Shortcuts

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