# HG changeset patch # User Olaf Wintermann # Date 1458135175 -3600 # Node ID cd870d5f865933874ed79f2afdfc5a093768752f # Parent 01e80c7cfe969e4539380ef6a98902bf96bbfb65 added options for extended list flags and changed version output dav list -e indicates resource locks and the apache executable property diff -r 01e80c7cfe96 -r cd870d5f8659 dav/main.c --- a/dav/main.c Tue Mar 15 16:47:22 2016 +0100 +++ b/dav/main.c Wed Mar 16 14:32:55 2016 +0100 @@ -69,6 +69,7 @@ xmlGenericErrorFunc fnc = xmlerrorfnc; initGenericErrorDefaultFunc(&fnc); ctx = dav_context_new(); + dav_add_namespace(ctx, "apache", "http://apache.org/dav/props/"); load_config(ctx); printxmlerror = 0; #ifdef DO_THE_TEST @@ -135,11 +136,7 @@ } else if(!strcasecmp(cmd, "list-repositories")) { ret = list_repositories(); } else if(!strcasecmp(cmd, "version") || !strcasecmp(cmd, "-version") || !strcasecmp(cmd, "--version")) { -#ifdef DEBUG - fprintf(stderr, "dav %s unstable\n", DAV_VERSION); -#else fprintf(stderr, "dav %s\n", DAV_VERSION); -#endif } else { print_usage(argv[0]); } @@ -156,7 +153,7 @@ void print_usage(char *cmd) { fprintf(stderr, "Usage: %s command [options] arguments...\n\n", cmd); fprintf(stderr, "Commands:\n"); - fprintf(stderr, " list [-altpcR] [-u ] \n"); + fprintf(stderr, " list [-altepcR] [-u ] \n"); fprintf( stderr, " get [-pcR] [-o ] [-u ] \n"); @@ -192,9 +189,11 @@ fprintf(stderr, " -a show all files\n"); fprintf(stderr, " -l print resources in long list format\n"); fprintf(stderr, " -t print content type\n"); + fprintf(stderr, " -e show extended flags\n"); fprintf(stderr, " -O override resources\n"); fprintf(stderr, " -L specificy lock token\n"); fprintf(stderr, " -n specify namespace uri\n"); + fprintf(stderr, " -N disable authentication and key input (all commands)\n"); fprintf(stderr, " -i disable cert verification (all commands)\n"); fprintf(stderr, " -v verbose output (all commands)\n"); fprintf(stderr, "\n"); @@ -368,7 +367,7 @@ while(ret != 0) { ls = dav_query( sn, - "select `idav:crypto-name`,`idav:crypto-key`,D:lockdiscovery from %s with depth = %d where lastmodified > %t order by iscollection desc, name", + "select `idav:crypto-name`,`idav:crypto-key`,D:lockdiscovery,apache:executable from %s with depth = %d where lastmodified > %t order by iscollection desc, name", path, depth, t); @@ -385,7 +384,7 @@ // parameters void (*print_func)(DavResource*, CmdArgs *); - if(cmd_getoption(a, "list")) { + if(cmd_getoption(a, "list") || cmd_getoption(a, "extended")) { print_func = ls_print_list_elm; } else { print_func = ls_print_elm; @@ -506,7 +505,6 @@ char flags[16]; memset(flags, '-', 15); - flags[3] = '\0'; int type_width = 0; char *type = res->contenttype; @@ -522,8 +520,21 @@ if(keyprop) { flags[1] = 'c'; } - if(dav_get_property(res, "D:lockdiscovery")) { - flags[2] = 'l'; + + if(cmd_getoption(a, "extended")) { + flags[6] = '\0'; + if(dav_get_property(res, "D:lockdiscovery")) { + flags[2] = 'l'; + } + char *executable = dav_get_property_ns( + res, + "http://apache.org/dav/props/", + "executable"); + if(executable && util_getboolean(executable)) { + flags[3] = 'x'; + } + } else { + flags[2] = '\0'; } if(cmd_getoption(a, "type")) { diff -r 01e80c7cfe96 -r cd870d5f8659 dav/optparser.c --- a/dav/optparser.c Tue Mar 15 16:47:22 2016 +0100 +++ b/dav/optparser.c Wed Mar 16 14:32:55 2016 +0100 @@ -109,10 +109,14 @@ ucx_map_cstr_put(a->options, "insecure", NOARG); break; } - case 'x': { + case 'N': { ucx_map_cstr_put(a->options, "noinput", NOARG); break; } + case 'e': { + ucx_map_cstr_put(a->options, "extended", NOARG); + break; + } case 'o': { if(!option) { option = "output";