|
21 | 21 | from datetime import datetime, timedelta, timezone |
22 | 22 | from typing import Any, BinaryIO, Callable, Iterator, TextIO |
23 | 23 |
|
24 | | -from dissect.cstruct import hexdump |
25 | 24 | from flow.record import RecordOutput |
26 | 25 |
|
| 26 | +from dissect.cstruct import hexdump |
27 | 27 | from dissect.target.exceptions import ( |
28 | 28 | PluginError, |
29 | 29 | RegistryError, |
@@ -304,11 +304,11 @@ def _exec_(argparts: list[str], stdout: TextIO) -> bool: |
304 | 304 | no_cyber = cmdfunc.__func__ in (TargetCli.cmd_registry, TargetCli.cmd_enter) |
305 | 305 | return self._exec(_exec_, command_args_str, no_cyber) |
306 | 306 |
|
307 | | - def do_man(self, line: str) -> bool: |
| 307 | + def do_man(self, line: str) -> None: |
308 | 308 | """alias for help""" |
309 | | - return self.do_help(line) |
| 309 | + self.do_help(line) |
310 | 310 |
|
311 | | - def complete_man(self, *args) -> list[str]: |
| 311 | + def complete_man(self, *args: list[str]) -> list[str]: |
312 | 312 | return cmd.Cmd.complete_help(self, *args) |
313 | 313 |
|
314 | 314 | def do_unalias(self, line: str) -> bool: |
@@ -403,16 +403,14 @@ def __init__(self, target: Target): |
403 | 403 | self.histfile = pathlib.Path(getattr(target._config, "HISTFILE", self.DEFAULT_HISTFILE)).expanduser() |
404 | 404 |
|
405 | 405 | # prompt format |
| 406 | + self.prompt_ps1 = "{BOLD_GREEN}{base}{RESET}:{BOLD_BLUE}{cwd}{RESET}$ " |
406 | 407 | if ps1 := getattr(target._config, "PS1", None): |
407 | 408 | if "{cwd}" in ps1 and "{base}" in ps1: |
408 | 409 | self.prompt_ps1 = ps1 |
409 | 410 |
|
410 | 411 | elif getattr(target._config, "NO_COLOR", None) or os.getenv("NO_COLOR"): |
411 | 412 | self.prompt_ps1 = "{base}:{cwd}$ " |
412 | 413 |
|
413 | | - else: |
414 | | - self.prompt_ps1 = "{BOLD_GREEN}{base}{RESET}:{BOLD_BLUE}{cwd}{RESET}$ " |
415 | | - |
416 | 414 | super().__init__(self.target.props.get("cyber")) |
417 | 415 |
|
418 | 416 | def _get_targetrc_path(self) -> pathlib.Path: |
|
0 commit comments