From 84bfea7add93a98f83ad958151cca718c33bc0a4 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 11 Jan 2019 02:31:29 +0000 Subject: Add the stdio backend This patch adds the stdio backend which acts as a fallback backend and uses standard input and output. For password queries, the rpassword crate is used to suppress output. Also, default_backend is changed to return Stdio if Dialog is not available. --- src/backends/dialog.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/backends/dialog.rs') diff --git a/src/backends/dialog.rs b/src/backends/dialog.rs index 6f078e6..e681caf 100644 --- a/src/backends/dialog.rs +++ b/src/backends/dialog.rs @@ -49,6 +49,10 @@ impl Dialog { self.width = width.to_string(); } + pub(crate) fn is_available() -> bool { + super::is_available("dialog") + } + fn execute( &self, args: Vec<&str>, -- cgit v1.2.1