From d137415a69007a90569ebbf38a92424fba60b997 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 18 Dec 2018 00:39:15 +0100 Subject: Add argparse 0.2.2 as a dependency This patch adds the crate rust-argparse [0] in version 0.2.2 as a dependency, as discussed in issue #4. [0] https://github.com/tailhook/rust-argparse Import subrepo argparse/:argparse at 0de60a5e6d9ee1a3570d6089afd3ccd6ed7480c5 --- argparse/src/print.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 argparse/src/print.rs (limited to 'argparse/src/print.rs') diff --git a/argparse/src/print.rs b/argparse/src/print.rs new file mode 100644 index 0000000..d0335c5 --- /dev/null +++ b/argparse/src/print.rs @@ -0,0 +1,13 @@ +use Print; +use action::{IFlagAction, ParseResult}; + +impl IFlagAction for Print { + fn parse_flag(&self) -> ParseResult { + if self.0.ends_with("\n") { + print!("{}", self.0); + } else { + println!("{}", self.0); + } + return ParseResult::Exit; + } +} -- cgit v1.2.1