diff options
Diffstat (limited to 'argparse/src/print.rs')
-rw-r--r-- | argparse/src/print.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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; + } +} |