|
| 1 | +# M1.10 Patterned and Implied `CD` State Transfer |
| 2 | + |
| 3 | +M1.10 closes most of the remaining interactive current-directory state gap without introducing an AmShell pattern parser. |
| 4 | + |
| 5 | +## Explicit patterned `CD` |
| 6 | + |
| 7 | +The original Shell supports patterns in `CD`, for example: |
| 8 | + |
| 9 | +```text |
| 10 | +CD SYS:Li#? |
| 11 | +``` |
| 12 | + |
| 13 | +AmShell now resolves explicit `CD` patterns with the native V36+ dos.library directory-scanning API: |
| 14 | + |
| 15 | +- `MatchFirst()` |
| 16 | +- `MatchNext()` |
| 17 | +- `MatchEnd()` |
| 18 | + |
| 19 | +The matcher is allowed to interpret AmigaDOS pattern syntax. AmShell does not reimplement `#?`, `?`, alternation, negation, classes, or related semantics. |
| 20 | + |
| 21 | +Only directory matches count. Exactly one matching directory is required before AmShell updates its own process current directory with `CurrentDir()`. If matching fails, is ambiguous, is interrupted, or otherwise does not produce exactly one directory, the original `CD` command line is delegated unchanged to the native system Shell so diagnostics and RC remain native. |
| 22 | + |
| 23 | +This follows the documented Shell behavior that patterned `CD` succeeds for one matching directory and reports an error when more than one directory matches. |
| 24 | + |
| 25 | +## Exact `CD` |
| 26 | + |
| 27 | +Exact paths continue to use `Lock()` and `CurrentDir()`. M1.10 additionally verifies with `Examine()` that the lock is a directory before installing it as the process current directory. Invalid or non-directory targets are delegated to the native Shell for diagnostics and RC. |
| 28 | + |
| 29 | +Quoted exact paths remain supported by the conservative outer decoder introduced in M1.8. |
| 30 | + |
| 31 | +## Path-like implied `CD` |
| 32 | + |
| 33 | +The Shell also supports implied `CD`, where the user omits the `CD` command. M1.10 transfers state directly for path-like standalone tokens containing `:` or `/`, including forms such as: |
| 34 | + |
| 35 | +```text |
| 36 | +SYS:Tools |
| 37 | +/ |
| 38 | +// |
| 39 | +: |
| 40 | +``` |
| 41 | + |
| 42 | +The target must resolve through `Lock()` to a directory. Pattern syntax is not accepted for implied `CD`, matching the documented Shell restriction that patterns require explicit `CD`. |
| 43 | + |
| 44 | +## Deferred bare-name implied `CD` |
| 45 | + |
| 46 | +A standalone bare directory name such as: |
| 47 | + |
| 48 | +```text |
| 49 | +Tools |
| 50 | +``` |
| 51 | + |
| 52 | +can also be an implied `CD` in the original Shell. AmShell deliberately continues to delegate this form for now because command lookup and directory-name precedence must be qualified before intercepting it safely. A directory and an executable may legally share a candidate command name, and compatibility takes priority over convenience. |
| 53 | + |
| 54 | +The combined M1 final qualification must therefore include explicit patterned `CD`, path-like implied `CD`, and command-vs-directory precedence cases before the remaining bare-name implied surface can be declared equivalent. |
| 55 | + |
| 56 | +## Runtime status |
| 57 | + |
| 58 | +Implementation and host/CI structural checks do not constitute runtime qualification. M1.10 runtime execution remains deferred to the combined visible FS-UAE / AmigaOS 2.04 M1 final qualification. |
0 commit comments