Fossil SCM

Add the 'test-prompt-user' command.

mistachkin 2016-10-22 08:26 trunk
Commit 8817b0ed6eb2a9583f79478dfdb7b3381e696cf4
1 file changed +15
+15
--- src/user.c
+++ src/user.c
@@ -553,10 +553,25 @@
553553
db_multi_exec(
554554
"UPDATE user SET pw=shared_secret(pw,login), mtime=now()"
555555
" WHERE length(pw)>0 AND length(pw)!=40"
556556
);
557557
}
558
+
559
+/*
560
+** COMMAND: test-prompt-user
561
+**
562
+** Usage: %fossil test-prompt-user PROMPT
563
+**
564
+** Prompts the user for input and then prints it verbatim (i.e. without
565
+** a trailing line terminator).
566
+*/
567
+void test_prompt_user_cmd(void){
568
+ Blob answer;
569
+ if( g.argc!=3 ) usage("PROMPT");
570
+ prompt_user(g.argv[2], &answer);
571
+ fossil_print("%s", blob_str(&answer));
572
+}
558573
559574
/*
560575
** WEBPAGE: access_log
561576
**
562577
** Show login attempts, including timestamp and IP address.
563578
--- src/user.c
+++ src/user.c
@@ -553,10 +553,25 @@
553 db_multi_exec(
554 "UPDATE user SET pw=shared_secret(pw,login), mtime=now()"
555 " WHERE length(pw)>0 AND length(pw)!=40"
556 );
557 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
558
559 /*
560 ** WEBPAGE: access_log
561 **
562 ** Show login attempts, including timestamp and IP address.
563
--- src/user.c
+++ src/user.c
@@ -553,10 +553,25 @@
553 db_multi_exec(
554 "UPDATE user SET pw=shared_secret(pw,login), mtime=now()"
555 " WHERE length(pw)>0 AND length(pw)!=40"
556 );
557 }
558
559 /*
560 ** COMMAND: test-prompt-user
561 **
562 ** Usage: %fossil test-prompt-user PROMPT
563 **
564 ** Prompts the user for input and then prints it verbatim (i.e. without
565 ** a trailing line terminator).
566 */
567 void test_prompt_user_cmd(void){
568 Blob answer;
569 if( g.argc!=3 ) usage("PROMPT");
570 prompt_user(g.argv[2], &answer);
571 fossil_print("%s", blob_str(&answer));
572 }
573
574 /*
575 ** WEBPAGE: access_log
576 **
577 ** Show login attempts, including timestamp and IP address.
578

Keyboard Shortcuts

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