Repository navigation
feat(cli): add command-line arguments for mode, source, and parameter… - #70
Merged
Merged
Conversation
… overrides also update `README.md`
Clean up formatting and styling across app, parameters, and menu modules, including making SessionBuilder::new a const function and adjusting code block layouts.
1 task done
mahlquistj
previously approved these changes
Aug 12, 2026
mahlquistj
left a comment
Owner
There was a problem hiding this comment.
LGTM 👍
I'll test it myself before i release it properly - Thank you for contributing 😊
Owner
|
Some pedantic lint errors are shown in the CI. You can ignore the "Check Version Updated" 👍 I'll merge when the lints are fixed 😁 |
…ting this fixes linting CI
Contributor
Author
|
Hi.. the CI errors should pass now. I have not changed the version number like you told me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds command-line arguments (
--mode,--source,--param) to allow starting Octotype sessions directly from terminal scripts, desktop shortcuts, or shell commands without requiring manual UI navigation.Closes #15
Features Added
1. Pre-selecting Mode (
--mode/-m)Passing
--mode <mode_name>pre-selects the requested mode and opens Octotype directly at the Source Selection screen.octotype --mode "WordRace"2. Instant Session Start (
--mode+--source)Passing both
--mode <mode_name>and--source <source_name>launches directly into the word loader and typing session:3. Parameter Overrides (
--param/-P)Passing one or more
--param "<name>:<value>"options overrides parameters for the selected mode and source combination:Implementation Details
src/main.rs): ExtendedAppArgsstruct usingclap. Enforces strict dependency chains (--sourcerequires--mode,--paramrequires--source).src/config/parameters.rs):Parameter::set_value_from_strfor in-place mutation with bounds checking forRangedefinitions, case-insensitive string selection, boolean toggle parsing, and fixed parameter locking.src/page/menu.rs):SessionBuilder<'a>to handle mode/source resolution, parameter combination, mode overrides, CLI parameter application, and loader creation.create_cli_sessionusesSessionBuilderfor clean, fluent session construction.ratatui. Invalid modes, sources, or parameters output a clean error tostderrand exit with status code1.README.md): Updated the CLI Arguments reference table with-m/--mode,-s/--source, and-P/--param.Testing
--helpoutput formatting.src/config/parameters.rs.cargo test(all passing cleanly).