Remove old macros and add `sub-command` function inspired by tools.cli