[PATCH 4/5] programs/cmd: Introduce helper for handling pipe commands.