2

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.

victorx
  • 3,267
  • 2
  • 25
  • 35

1 Answers1

3

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}
schettino72
  • 2,990
  • 1
  • 28
  • 27
  • Thanks @schettino72. What you suggest defenitly works, but I'm thinking more of a command line option instead of modifying the file itself. Do you know whether there is such a command line option? – victorx Nov 24 '19 at 22:58
  • Currently not possible, but it would be a nice addition to `info` command. Please create an issue on github. It should be trivial to add this feature. – schettino72 Nov 25 '19 at 06:34
  • 1
    Created. https://github.com/pydoit/doit/issues/335. Did not realize you are the main contributor of the pacakge. Nice work! – victorx Nov 25 '19 at 22:27