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

Re: view onto command pipeline?



On Wed, Jul 20, 2022 at 9:12 PM Anthony Heading <ajrh@xxxxxxxx> wrote:
>
> On Wed, Jul 20, 2022, at 9:35 PM, Lawrence Velázquez wrote:
> > On Wed, Jul 20, 2022, at 8:15 PM, Anthony Heading wrote:
> >> Agree
> >> quoting $@ makes sense here since this is a wrapper, but I find more
> >> often dropping empty
> >> arguments is often very helpful after splits and suchlike.
> >>
> >> But as to "${opts[@]}"...   Just too ugly to do that all the time, no?
> >> Instead, use
> >> zsh's awesome sticky emulation:
> >>
> >>     emulate zsh -c 'autoload -Uz ~/my-zsh-funcs/*'
> >
> > Leaving $opts[@] unquoted still elides empty elements in this
> > context; that behavior is not limited to $@.  (If this is what you
> > actually want, go for it.  Just don't think that fiddling with
> > options has an effect.)
> >
>
> Yes indeed!  Though recall the context here was a *fixed* *literal* array:
>     opts=(-c color.ui=always)
>     command git $opts "$@"
>
> Quoting "$@" agreed, but writing "${opts[@]}" instead here seems
> a little bit like self-flagellation, no?

Why not simply use git existing functionality?

    GIT_CONFIG_PARAMETERS="'color.ui=always'"

-- 
Felipe Contreras




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