diff --git a/cmdline/cmdline.c b/cmdline/cmdline.c index aa1c19b6..925b5c77 100644 --- a/cmdline/cmdline.c +++ b/cmdline/cmdline.c @@ -1162,6 +1162,10 @@ char* mrmailbox_cmdline(mrmailbox_t* mailbox, const char* cmdline) * Misc. ******************************************************************************/ + else if( strcmp(cmd, "getqr")==0 ) + { + ret = mrmailbox_get_qr(mailbox); + } else if( strcmp(cmd, "checkqr")==0 ) { if( arg1 ) { diff --git a/cmdline/main.c b/cmdline/main.c index e8ae2d8a..e8a2879a 100644 --- a/cmdline/main.c +++ b/cmdline/main.c @@ -157,6 +157,15 @@ int main(int argc, char ** argv) printf("\n\n\n\n"); /* insert some blank lines to visualize the break in the buffer */ printf("\e[1;1H\e[2J"); /* should work on ANSI terminals and on Windows 10. If not, well, then not. */ } + else if( strcmp(cmd, "getqr")==0 ) + { + char* qrstr = mrmailbox_get_qr(mailbox); + printf("%s\n", qrstr); + char* syscmd = mr_mprintf("qrencode -t UTF8 \"%s\" -o -", qrstr); + system(syscmd); + free(syscmd); + free(qrstr); + } else if( strcmp(cmd, "exit")==0 ) { break;