Andrew Witt wrote:
> ... I don't see a way to do it, except to write a patch for
> a new option for 'cls' which will list only directories.
Alex -
I believe the below diff's are all that it would take to make a
new option to the lftp 'cls' command to list only directories,
while supporting all of the existing formatting options that
the 'cls' command already has.
I'm submitting it for inclusion, if you think it would be useful.
- Andrew
lftp-3.5.4/src $ diff commands.cc.001 commands.cc
189a190
> " -E, --dirsonly - list only directories\n"
1452a1454
> {"dirsonly",no_argument,0,'E'},
1469c1471
< while((opt=a->getopt_long(":1BdFhiklqsDISrt", cls_options, &longopt))!=EOF)
---
> while((opt=a->getopt_long(":1BdFhiklqsDEISrt", cls_options,
&longopt))!=EOF)
1542a1545,1547
> case('E'):
> show_dirs_only = true;
> break;
lftp-3.5.4/src $ diff FileSetOutput.cc.001 FileSetOutput.cc
83a84,86
> if((f->filetype != FileInfo::DIRECTORY) && (show_dirs_only))
> continue;
>
lftp-3.5.4/src $ diff FileSetOutput.h.001 FileSetOutput.h
61a62
> bool show_dirs_only;
73c74
< sort_dirs_first(false), size_filesonly(false), single_column(false),
---
> sort_dirs_first(false), show_dirs_only(false), size_filesonly(false),
single_column(false),
--
Andrew Witt
Sr. Software Engineer
Revol - www.revol.us - Freedom is calling