Repository navigation
Conversation
…nds. Argument validation printed an error and called process.exit(1) in about 30 places. These now throw, and the existing handler in main() prints "Error: <message>" and exits with status 1, so the output stays the same. This makes the commands usable from a long-running process, such as an interactive prompt, where a typo must not end the process. An unknown command now prints a one-line error that points to --help, instead of the error followed by the full help text.
…cess.argv. wasExplicit() decides whether to print the "Other subcommands" hint. It searched process.argv for the parent and subcommand names. It now checks the operands that commander recorded on the parent command, which reflect the arguments that were actually parsed, wherever they came from.
This prepares for an interactive prompt, which needs a fresh program for every line it runs. No behavior change.
"profiler-cli -i [<command>]" runs <command>, if given, and then shows a "> " prompt. Each line is a profiler-cli command without the "profiler-cli" prefix, parsed by a fresh commander program. Errors are printed and the prompt continues. "exit", "quit" or Ctrl-D leave it. The prompt pins the session it loaded, so a "load" in another terminal does not redirect it. "load" and "session use" at the prompt change the pinned session. When the prompt exits, it stops the sessions it loaded, because daemons have no idle timeout and would otherwise keep a profile in memory indefinitely. Sessions that were already running are left alone. The separate-commands mode is unchanged and remains the interface for scripts and AI tools.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6400 +/- ##
=======================================
Coverage 84.48% 84.48%
=======================================
Files 357 357
Lines 38675 38675
Branches 10957 10957
=======================================
Hits 32675 32675
Misses 5565 5565
Partials 435 435 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Main | Deploy preview
This makes it so that
profiler-cli -i load https://share.firefox.dev/4dJfrbAgives you a REPL style interface.