Skip to content

Commit

Permalink
added docs for raw mode cli command
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikwilkowski committed Jun 16, 2024
1 parent 039de32 commit 81ff9c3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,37 @@ $ cfonts "text" --max-length 15
![Max length command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/released/img/max-length.png)


#### -r, --raw-mode
Type: `<boolean>`
Default value: `false`

Set this option to make sure `cfonts` used `CRLF` (`\r\n`) over the default `LF` (`\n`) [line breaks](https://en.wikipedia.org/wiki/Newline).
This could be useful for terminal raw modes or on older windows machines.


```rust
use crossterm::terminal;
use std::io::Write;
use cfonts;

fn main() -> std::io::Result<()> {
terminal::enable_raw_mode()?;

cfonts::say(cfonts::Options {
text: String::from("Hello|world"),
raw_mode: true,
..cfonts::Options::default()
});

std::io::stdout().flush()?;
terminal::disable_raw_mode()?;
Ok(())
}
```

![Raw mode command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/released/img/raw-mode.png)


#### -e, --env
Type: `<string>`
Default value: `cli`
Expand Down
Binary file added img/raw-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 81ff9c3

Please sign in to comment.