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

Re: debug functions



On Wed, Feb 10, 2021 at 2:08 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
> function_name (){
>   functions -T $0
>   ...
> }

I think it'd be a bit convoluted ...

function_name () {
  if [[ -o xtrace ]]
  then
    # The real function body here
  else
    functions -T function_name
    {
      function_name "$@"
    } always {
      functions +T function_name
    }
  fi
}




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