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

Re: [PATCH 1/4] Update system_profiler completion



> 2023/08/23 13:00, Shohei YOSHIDA <syohex@xxxxxxxxx> wrote:
> 
> ---
> Completion/Darwin/Command/_system_profiler | 3 ++-

The patch is OK, of course.
But _system_profiler has the following comment:

# TODO: Should this be static?  Calling `system_profiler -listDataTypes` takes
# about 0.07-0.08 secs on my machine.  Does this list ever change (between
# different versions of OS X)?
_data_types=( SP{AirPort,Applications,Audio,...(snip)...,WWAN}DataType )
# the dynamic alternative is:
#_data_types=( ${${(f)"$(_call_program path system_profiler -listDataTypes 2>/dev/null)"}[2,-1]} )

At least on macOS Ventura (the latest), "system_profiler -listDataTypes"
gives somewhat different list of data types. And I think the time
required by this command is negligible (I can't notice any delay).
So isn't it better to use the 'dynamic alternative' in the above comment?

The tag name 'path' used in the _call_program is not appropriate.
It would be better to use, for example, 'data-types'.



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