0

I want something like this:

# source:
a() b mp3 m4a "$@"
b() eval "${1}-to-${2} $@:q"
alias mp3-to-m4a='ffmpeg ...'
# 
$ traceall a a.mp3 a.m4a
 # should return:
 Functions:
 a
 b
 Aliases:
 mp3-to-m4a
 commands:
 ffmpeg

2 Answers 2

2

You might look at trap with the DEBUG pseudosignal. This only triggers for commands and functions, though, and only after alias expansion. You want to read the details in the zsh manual, because it runs a command or function giving it information about what's about to be executed, rather than recording information directly; you could use this hypothetically to implement a full debugger.

1

Turn xtrace globally:

> set -x; a a.mp3 a.m4 ; set +x

or turn on xtrace for functions, then execute it:

> typeset -tf a   # turns on xtrace for function a and below
> a a.mp3 a.m4

> typeset -Tf a   # turns on xtrace for function a only
> a a.mp3 a.m4

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.