@@ -398,6 +398,10 @@ defmodule Hemdal.Host do
398398 end
399399 end
400400
401+ defp exec_cmd ( handler , mod , % Command { type: "interactive" , command: command } , [ pid ] ) do
402+ mod . exec_interactive ( handler , command , pid )
403+ end
404+
401405 @ typedoc """
402406 Handler is used by the backend implementation of the host, it could be
403407 whatever depending on the needs of the backend implementation. For
@@ -452,11 +456,19 @@ defmodule Hemdal.Host do
452456
453457 @ doc """
454458 Exec a command using the method implemented by the module where it's
455- implemented. The `exec/2` command is getting a handler from the transaction
459+ implemented. The `c: exec/2` command is getting a handler from the transaction
456460 and the command to be executed as a string.
457461 """
458462 @ callback exec ( handler ( ) , command ( ) ) :: { :ok , errorlevel ( ) , output ( ) } | { :error , reason ( ) }
459463
464+ @ doc """
465+ Exec an interactive command implemented by the module where it's
466+ implemented. The `c:exec_interactive/3` command is getting a handler from the
467+ transaction and the command to be executed as a string.
468+ """
469+ @ callback exec_interactive ( handler ( ) , command ( ) , pid ( ) ) ::
470+ { :ok , errorlevel ( ) , output ( ) } | { :error , reason ( ) }
471+
460472 @ doc """
461473 Write a file in the remote (or local) host. It's intended to write the
462474 scripts which will be needed to be executed after that with `exec/2`.
@@ -466,7 +478,7 @@ defmodule Hemdal.Host do
466478
467479 @ doc """
468480 Remove a file which was created with `write_file/3` when the execution of
469- the script was finalised .
481+ the script was finalized .
470482 """
471483 @ callback delete ( handler ( ) , tpm_file :: charlist ( ) ) :: :ok | { :error , reason ( ) }
472484
0 commit comments