From: Fredrik Tolf Date: Sun, 6 Apr 2008 13:00:16 +0000 (+0200) Subject: Only print file link name in lsdl. X-Git-Tag: 1.3~11^2^2~15^2 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=00b8bb0b4f33936fa28ab0b1ef21c5290e844d07;p=doldaconnect.git Only print file link name in lsdl. --- diff --git a/clients/tty/dcsh.c b/clients/tty/dcsh.c index 835aa8b..60904b9 100644 --- a/clients/tty/dcsh.c +++ b/clients/tty/dcsh.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include @@ -91,20 +92,24 @@ int cmd_lsdl(int argc, wchar_t **argv) { struct dc_response *resp; struct dc_intresp *ires; + wchar_t *file, *p; resp = dc_gettaggedrespsync(dc_queuecmd(NULL, NULL, L"lstrans", NULL)); if(resp->code == 200) { if(interactive) { - printf("ID S USER FILE\n"); - printf("------- - --------------- ----------------------------------------------------\n"); + printf("ID S USER PROGRESS FILE\n"); + printf("------- - ---------- ------------- -------------------------------------------\n"); } while((ires = dc_interpret(resp)) != NULL) { if(ires->argv[1].val.num == DC_TRNSD_DOWN) { + file = ires->argv[5].val.str; + if((p = wcsrchr(file, L'/')) != NULL) + file = p + 1; if(interactive) { - wcslimit(ires->argv[4].val.str, 15); - wcslimitr(ires->argv[5].val.str, 52); + wcslimit(ires->argv[4].val.str, 10); + wcslimit(file, 43); } - printf("%-7i %c %-15ls %ls\n", ires->argv[0].val.num, "SHED"[ires->argv[2].val.num], ires->argv[4].val.str, ires->argv[5].val.str); + printf("%-7i %c %-10ls %'-13ji %ls\n", ires->argv[0].val.num, "SHED"[ires->argv[2].val.num], ires->argv[4].val.str, (intmax_t)ires->argv[7].val.lnum, file); } dc_freeires(ires); }