Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Multi-element zstat



> tt(zstat )[ tt(-gnNolLtTrs) ] [ tt(-f) var(fd) ] \
>     [ tt(-H) var(hash) ] [ tt(-A) var(array) ] \
>     [ tt(-F) var(fmt) ]
>     [ tt(PLUS())var(element) ] [ var(file) ... ]
⋮
> A particular element may be selected by including its name
> preceded by a `tt(PLUS())' in the option list; only one element is allowed.
> The element may be shortened to any unique set of leading
> characters.  Otherwise, all elements will be shown for all files.

How about extending the syntax to permit specifying multiple elements,
in which case only those will be shown?  E.g., «zstat +uid:gid:mode
./foo» or «zstat +uid +gid +mode ./foo»?  The latter syntax would
necessitate an incompatible change notice in NEWS/README (because «zstat
+mode +foo» does stat("+foo"), exactly as the docstring promises).  The
output of the example invocation would be as follows (assuming -o is
also passed for sanity):
.
	mode    0100644
	uid     1000
	gid     1000

Looping over the one-element syntax isn't convenient when multiple file
targets are passed.  Ditto grepping the output.

Just looking for consensus on the direction at this point; not planning
to implement this immediately.

Cheers,

Daniel




Messages sorted by: Reverse Date, Date, Thread, Author