rewrite cmds functions by macro
rewrite inline cmds functions with macro