initialze local flags with the global flags
| 3863 | |
| 3864 | // initialze local flags with the global flags |
| 3865 | void Query::get_flags() |
| 3866 | { |
| 3867 | // remember file and directory restrictions, when specified, to enable/disable with ALT-@ |
| 3868 | exclude_ = flag_exclude; |
| 3869 | exclude_dir_ = flag_exclude_dir; |
| 3870 | include_ = flag_include; |
| 3871 | include_dir_ = flag_include_dir; |
| 3872 | file_magic_ = flag_file_magic; |
| 3873 | ignore_files_ = flag_ignore_files; |
| 3874 | |
| 3875 | // remember the context size, when specified |
| 3876 | if (flag_hexdump != NULL) |
| 3877 | { |
| 3878 | if (flag_hex_after > 0) |
| 3879 | context_ = flag_hex_after; |
| 3880 | else if (flag_hex_before > 0) |
| 3881 | context_ = flag_hex_before; |
| 3882 | else |
| 3883 | context_ = 0; |
| 3884 | } |
| 3885 | else if (flag_only_matching) |
| 3886 | { |
| 3887 | if (flag_after_context > 0) |
| 3888 | only_context_ = flag_after_context; |
| 3889 | else if (flag_before_context > 0) |
| 3890 | only_context_ = flag_before_context; |
| 3891 | } |
| 3892 | else |
| 3893 | { |
| 3894 | if (flag_after_context > 0) |
| 3895 | context_ = flag_after_context; |
| 3896 | else if (flag_before_context > 0) |
| 3897 | context_ = flag_before_context; |
| 3898 | } |
| 3899 | |
| 3900 | // remember the --fuzzy max, when specified |
| 3901 | if (flag_fuzzy > 0) |
| 3902 | fuzzy_ = flag_fuzzy; |
| 3903 | |
| 3904 | // remember --dotall |
| 3905 | dotall_ = flag_dotall; |
| 3906 | |
| 3907 | // get the -g, -O, and -t globs |
| 3908 | for (auto& glob : flag_glob) |
| 3909 | { |
| 3910 | if (!glob.empty()) |
| 3911 | { |
| 3912 | if (!globs_.empty()) |
| 3913 | globs_.push_back(','); |
| 3914 | globs_.append(glob); |
| 3915 | } |
| 3916 | } |
| 3917 | |
| 3918 | // get the --iglob |
| 3919 | for (auto& glob : flag_iglob) |
| 3920 | { |
| 3921 | if (!glob.empty()) |
| 3922 | { |