fix(init): show usage menu when called without arguments#235
Open
fix(init): show usage menu when called without arguments#235
Conversation
Previously `flash init` with no arguments silently initialized in the current directory (same as `flash init .`). Now it shows a usage panel with examples and exits, matching expected CLI behavior: - `flash init` prints usage menu - `flash init .` initializes in current directory - `flash init <name>` creates new project folder
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the flash init CLI behavior so invoking it without a project argument shows a usage/help panel and exits, making “initialize in current directory” an explicit flash init ..
Changes:
- Added an early-exit usage panel for
flash initwhen called with no positional argument. - Updated init logic so only
flash init .initializes the current directory (no longer the default when omitted). - Added/updated unit tests to cover the new no-args behavior (exit code, no skeleton creation, usage output).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/runpod_flash/cli/commands/init.py |
Adds no-args usage panel + exit and adjusts current-directory branching to require .. |
tests/unit/cli/commands/test_init.py |
Adds tests validating no-args exit behavior, output, and that no skeleton is created. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace hand-crafted usage text with ctx.get_help() to prevent drift when CLI options change. Update argument help text to clarify that '.' must be explicitly passed for current-directory init.
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
flash initwith no arguments now shows a usage panel with examples and exits instead of silently initializing in the current directoryflash init .continues to initialize in the current directory (unchanged)flash init <name>continues to create a new project folder (unchanged)Before:
flash initandflash init .had identical behavior -- both initialized in cwd.After:
flash initshows usage menu;flash init .is the explicit way to initialize in cwd.Test plan
Nonecreates skeleton (removed -- behavior changed)make quality-checkpasses (1261 tests, 73.75% coverage)flash init,flash init .,flash init <name>