读取命令行参数,命令行优先级更高,可覆盖配置文件参数
(self, args)
| 158 | self._report_file = os.path.abspath(report_file_value) |
| 159 | |
| 160 | def _read_args(self, args): |
| 161 | """ |
| 162 | 读取命令行参数,命令行优先级更高,可覆盖配置文件参数 |
| 163 | """ |
| 164 | if args.token: |
| 165 | self._token = args.token |
| 166 | if args.org_sid: |
| 167 | self._org_sid = args.org_sid |
| 168 | if args.team_name: |
| 169 | self._team_name = args.team_name |
| 170 | if args.source_dir: |
| 171 | self._source_dir = args.source_dir |
| 172 | if args.language: |
| 173 | self._languages = UserInput().format_languages(args.language) |
| 174 | if args.pre_cmd: |
| 175 | self._pre_cmd = args.pre_cmd |
| 176 | if args.build_cmd: |
| 177 | self._build_cmd = args.build_cmd |
| 178 | if args.username: |
| 179 | self._scm_auth_info.username = args.username |
| 180 | if args.password: |
| 181 | self._scm_auth_info.scm_password = args.password |
| 182 | if args.branch: |
| 183 | self._branch = args.branch |
| 184 | if args.scan_path: |
| 185 | self._scan_path = args.scan_path |
| 186 | if args.compare_branch: |
| 187 | self._compare_branch = args.compare_branch |
| 188 | if args.exclude_paths: |
| 189 | self._exclude_paths = StringMgr.str_to_list(args.exclude_paths) |
| 190 | if args.include_paths: |
| 191 | self._include_paths = StringMgr.str_to_list(args.include_paths) |
| 192 | if args.ssh_file: |
| 193 | self._scm_auth_info.ssh_file = args.ssh_file |
| 194 | if args.total_scan: # 命令行指定了全量扫描 |
| 195 | self._total_scan = args.total_scan |
| 196 | if args.report_file: |
| 197 | self._report_file = args.report_file |
| 198 | if args.scan_plan: |
| 199 | self._scan_plan = args.scan_plan |
| 200 | if args.ref_scheme_id: |
| 201 | self._ref_scheme_id = args.ref_scheme_id |
| 202 | if args.server_url: |
| 203 | self._server_url = args.server_url |
| 204 | |
| 205 | def _check_config_file(self, args): |
| 206 | """判断使用哪个ini配置文件""" |
no test coverage detected