Facilitates searching for the imported information
(self, arg)
| 99 | |
| 100 | |
| 101 | def do_search(self, arg): |
| 102 | """ |
| 103 | Facilitates searching for the imported information |
| 104 | """ |
| 105 | query_option = QueryType.NONE |
| 106 | option = None |
| 107 | value = None |
| 108 | hash_type = None |
| 109 | if len(arg.arg_list)==1: |
| 110 | query_option = QueryType.VALUES |
| 111 | value = arg.arg_list[0] |
| 112 | elif len(arg.arg_list) > 1: |
| 113 | option = arg.arg_list[0] |
| 114 | value = arg.arg_list[1] |
| 115 | if option == 'tables': |
| 116 | query_option = QueryType.TABLES |
| 117 | elif option == 'columns': |
| 118 | query_option = QueryType.COLUMNS |
| 119 | elif option in Settings.allow_hashes: |
| 120 | query_option = QueryType.VALUES |
| 121 | hash_type = option |
| 122 | else: |
| 123 | query_option = QueryType.VALUES |
| 124 | value = ' '.join(arg.arg_list) |
| 125 | |
| 126 | if query_option!= QueryType.NONE and value is not None: |
| 127 | self._core.run(query_option, value, hash_type) |
| 128 | else: |
| 129 | AnsiPrint.print_locale("errors.no_value_to_search") |
| 130 |
nothing calls this directly
no test coverage detected