Change the dir via console */
| 613 | |
| 614 | /* Change the dir via console */ |
| 615 | static bool ConChangeDirectory(std::span<std::string_view> argv) |
| 616 | { |
| 617 | if (argv.empty()) { |
| 618 | IConsolePrint(CC_HELP, "Change the dir via console. Usage: 'cd <directory | number>'."); |
| 619 | return true; |
| 620 | } |
| 621 | |
| 622 | if (argv.size() != 2) return false; |
| 623 | |
| 624 | std::string_view file = argv[1]; |
| 625 | _console_file_list_savegame.ValidateFileList(true); |
| 626 | const FiosItem *item = _console_file_list_savegame.FindItem(file); |
| 627 | if (item != nullptr) { |
| 628 | switch (item->type.detailed) { |
| 629 | case DFT_FIOS_DIR: |
| 630 | case DFT_FIOS_DRIVE: |
| 631 | case DFT_FIOS_PARENT: |
| 632 | FiosBrowseTo(item); |
| 633 | break; |
| 634 | default: IConsolePrint(CC_ERROR, "{}: Not a directory.", file); |
| 635 | } |
| 636 | } else { |
| 637 | IConsolePrint(CC_ERROR, "{}: No such file or directory.", file); |
| 638 | } |
| 639 | |
| 640 | _console_file_list_savegame.InvalidateFileList(); |
| 641 | return true; |
| 642 | } |
| 643 | |
| 644 | static bool ConPrintWorkingDirectory(std::span<std::string_view> argv) |
| 645 | { |
nothing calls this directly
no test coverage detected