libgrep_rs/
options.rs

1//! Contains structs required for the configuration of the searcher module
2
3///Configurations options for Searcher
4
5#[derive(Clone)]
6pub struct Options {
7    pub exclude: bool,
8    pub include_before: bool,
9    pub include_after: bool,
10    pub case_insensitive: bool,
11    pub regex: bool,
12    pub show_line: bool,
13}
14impl Default for Options {
15
16    fn default() -> Options {
17        Options {
18            exclude: false,
19            include_before: false,
20            include_after: false,
21            case_insensitive: false,
22            regex: false,
23            show_line: false,
24        }
25    }
26}
27impl Options {
28    pub fn new(exclude: bool, include_before: bool, include_after: bool,
29         case_insensitive: bool, regex: bool, show_line: bool) -> Options {
30        Options {
31            exclude,
32            include_before,
33            include_after,
34            case_insensitive,
35            regex,
36            show_line,
37        }
38    }
39}