X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=20fa3a96a4ccf1139d6d369ae8ff5764103e7822;hp=995c7552129512c6e2dc6228c165779c9e7979a0;hb=20ad4f0f93da79e2ec0a9699dff58b9922556438;hpb=ce6b826b855d3760324a46d0687ddb4a110aa890 diff --git a/aft.c b/aft.c index 995c7552..20fa3a96 100644 --- a/aft.c +++ b/aft.c @@ -74,6 +74,8 @@ enum ls_flags { LS_FLAG_ADMISSIBLE_ONLY = 2, /** -r */ LS_FLAG_REVERSE = 4, + /** -d */ + LS_FLAG_UNIXDATE = 8, }; /** @@ -800,10 +802,15 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts, goto out; } get_attribute_bitmap(&afsi->attributes, att_buf); - ret = get_local_time(&afsi->last_played, last_played_time, - sizeof(last_played_time), current_time, opts->mode); - if (ret < 0) - goto out; + if (opts->flags & LS_FLAG_UNIXDATE) + sprintf(last_played_time, "%llu", + (long long unsigned)afsi->last_played); + else { + ret = get_local_time(&afsi->last_played, last_played_time, + sizeof(last_played_time), current_time, opts->mode); + if (ret < 0) + goto out; + } get_duration_buf(afhi->seconds_total, duration_buf, opts); if (have_score) { if (opts->mode == LS_MODE_LONG) @@ -1458,6 +1465,10 @@ int com_ls(int fd, int argc, char * const * const argv) flags |= LS_FLAG_REVERSE; continue; } + if (!strcmp(arg, "-d")) { + flags |= LS_FLAG_UNIXDATE; + continue; + } if (!strncmp(arg, "-s", 2)) { if (!*(arg + 2) || *(arg + 3)) return -E_AFT_SYNTAX;