feat: positional remote command - #850
Merged
Merged
Conversation
Cursor passes the remote command as operands after the host, not only as -c. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #850 +/- ##
==========================================
+ Coverage 79.28% 79.41% +0.13%
==========================================
Files 125 127 +2
Lines 13090 13279 +189
Branches 8441 8572 +131
==========================================
+ Hits 10378 10546 +168
- Misses 1613 1626 +13
- Partials 1099 1107 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Command operands are parsed incorrectly after the host, and a required standard header is missing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds SSH-style positional remote commands while preserving -c fallback behavior.
Changes:
- Adds positional command and destination parsing helpers.
- Integrates command parsing and adds unit tests.
- Makes SSH configuration helpers inline.
| File | Description |
|---|---|
test/unit_tests/ClientArgParsingTest.cpp |
Tests positional commands and -c behavior. |
src/terminal/TerminalClientMain.cpp |
Integrates positional commands, but option-like command operands are incorrectly parsed as client options. |
src/terminal/ParseConfigFile.hpp |
Makes header-defined helpers inline. |
src/terminal/ClientArgParsing.hpp |
Adds parsing helpers but lacks the required <stdexcept> include. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cxxopts::value<std::vector<std::string>>()); | ||
|
|
||
| options.parse_positional({"host"}); | ||
| options.parse_positional({"host", "command_args"}); |
cxxopts was still parsing options after the destination, so ssh-style commands like `echo -n` and `sh -c` lost those words. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The compatibility client passes --serverfifo=/tmp/... before localhost:port. That equals form was treated as the destination, so et exited with "Missing host". Co-authored-by: Cursor <cursoragent@cursor.com>
ssh-style `et -- host command` was treating the host as a remote operand. Co-authored-by: Cursor <cursoragent@cursor.com>
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
et [options] user@host command...runs that command, the same shape as ssh.-cstill supplies the command when no positional command is present.--before the host ends client options, and the next token is the host.Test plan
-calone, dash operands after the host,--option=value, and--before the hostctest --test-dir build --output-on-failure --parallel