victorx
victorx

Reputation: 3569

python doit - how to echo the shell commands executed?

The action of my task is a shell command. Is there an option in doit to display the actual shell command executed?

The reason I want this feature is that the shell command is dynamically created by python expression, so I want to see the actual command to help troubleshooting.

Upvotes: 2

Views: 616

Answers (1)

schettino72
schettino72

Reputation: 3170

By default the task name is displayed, this can be changed with the title property.

doit distribution includes the helper function title_with_actions that does exactly what you are looking for.

from doit.tools import title_with_actions

def task_with_details():
    return {'actions': ['echo abc 123'],
            'title': title_with_actions}

Upvotes: 3

Related Questions