Expand description
§CliParse
Parses command-line arguments for workspace configuration.
§RESPONSIBILITIES
§Argument Parsing
- Parse CLI arguments
- Extract workspace file from arguments
- Validate workspace file extension
§ARCHITECTURAL ROLE
§Position in Mountain
- Early initialization component in Binary subsystem
- Provides workspace configuration from CLI
§Dependencies
- std::env: Environment argument access
§Dependents
- Fn() main entry point: Uses parsed CLI args
§SECURITY
§Considerations
- Validate workspace paths to prevent directory traversal
- Ensure only .code-workspace files are processed
§PERFORMANCE
§Considerations
- CLI parsing is fast, minimal overhead
Functions§
- HasWorkspace
Argument - Check if a workspace argument was provided.
- Parse
- Parse CLI arguments and extract workspace path.
- Parse
Workspace Folders - Parse workspace folder paths from CLI / env with the following precedence:
- Resolve
Recently 🔒Opened TopFolder - Read
~/.land/workspaces/RecentlyOpened.json’s top workspace entry and resolve it to a directory path. Mirrors the probe used byBinary/Build/WindowBuild.rs::BuildInitialUrlso the boot-seeded workspace folder agrees with the URL the webview actually loads. ReturnsNonewhen the file is missing/malformed, the entry has no resolvable path, the path doesn’t exist on disk, or it isn’t a directory. - Walk
UpTo 🔒Project Root - Walk up from
Startlooking for a project-root marker (Cargo.toml,package.json,.git,pyproject.toml,go.mod,pnpm-workspace.yaml). Returns the first ancestor that owns one. Falls back toStartitself when nothing matches before the filesystem root.