+ $cmd =~ s/\&([a-z_]+)/get_long("$1")/g;
+ # For debugging/testing, we print the call using printf() and thus need
+ # to generate a format string. The format uses %d for <number>s,
+ # literal numbers or state IDs and %s for NULL, <string>s and literal
+ # strings.
+
+ # remove the function name temporarily, so that the following
+ # replacements only apply to the arguments.
+ my ($funcname) = ($fmt =~ /^(.+)\(/);
+ $fmt =~ s/^$funcname//;
+
+ $fmt =~ s/$_/%d/g for @keys;