Skip to content

Rework Command class

Jean-Romain Garnier requested to merge (removed):rework_command_class into master

Related to !56 (merged)

The objective of this MR is to allow for cleaner code when creating differences from "commands" that that do not require calling a command line tool.

This adds a new Operation class, of which Command is a subclass, that is slightly more abstract. Differences are now created using from_operation rather than from_command, and exclude_command applies to every Operation using its description.

Here is the added layer of abstraction:

  • The description attribute replaces Command's shell_cmdline,
  • The name attribute can be used instead of cmdline()[0],
  • did_fail can be called rather than checking the returncode directly,
  • output and error_string replace stderr and stdout.

Merge request reports

Loading