dosutils: add Novell-style paging to FLAG tools and SLIST
- add a shared DOS pager helper for long tool output - page FLAG wildcard output with the Novell continue prompt - fix FLAGDIR current-directory handling for "." and volume root - add FLAGDIR wildcard directory listing support - page FLAGDIR wildcard output like Novell FLAGDIR - keep FLAGDIR display formatting aligned with Novell output - make SLIST /CONTINUE enable continuous output - keep SLIST bindery scanning compatible with ncpfs behavior - preserve SLIST NET_ADDRESS display and default server marking
This commit is contained in:
12
flag.c
12
flag.c
@@ -381,6 +381,14 @@ static void flag_display_one(char *name, uint32 attr)
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
|
||||
static void flag_display_one_paged(char *name, uint32 attr,
|
||||
int *line_count, int *continuous)
|
||||
{
|
||||
flag_display_one(name, attr);
|
||||
tool_page_line(line_count, continuous);
|
||||
}
|
||||
|
||||
|
||||
static int flag_has_wildcards(char *s)
|
||||
{
|
||||
while (*s) {
|
||||
@@ -395,6 +403,8 @@ static int flag_list(char *pattern)
|
||||
struct find_t ff;
|
||||
unsigned findattr = _A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_ARCH;
|
||||
int found = 0;
|
||||
int line_count = 0;
|
||||
int continuous = 0;
|
||||
|
||||
if (_dos_findfirst(pattern, findattr, &ff))
|
||||
return(-1);
|
||||
@@ -406,7 +416,7 @@ static int flag_list(char *pattern)
|
||||
if (flag_ncp87_obtain_attrs(ff.name, &nwattrs))
|
||||
nwattrs = (uint32)ff.attrib;
|
||||
|
||||
flag_display_one(ff.name, nwattrs);
|
||||
flag_display_one_paged(ff.name, nwattrs, &line_count, &continuous);
|
||||
found++;
|
||||
}
|
||||
} while (!_dos_findnext(&ff));
|
||||
|
||||
Reference in New Issue
Block a user