fix: add --socks5 and --connect flags to send subcommand#1053
Merged
schollz merged 1 commit intoschollz:mainfrom Feb 5, 2026
Merged
fix: add --socks5 and --connect flags to send subcommand#1053schollz merged 1 commit intoschollz:mainfrom
schollz merged 1 commit intoschollz:mainfrom
Conversation
Allow users to specify SOCKS5 and HTTP proxy settings directly on the send subcommand, enabling both syntaxes: - croc --socks5 "..." send file.txt (existing global flag) - croc send --socks5 "..." file.txt (new, more intuitive) This fixes the issue where users expected the more natural syntax of specifying flags after the subcommand, which previously only worked via the SOCKS5_PROXY environment variable. Fixes schollz#1051
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1051 by adding --socks5 and --connect flags to the send subcommand's flag list. Previously, these flags were only available as global flags (before the send command), which was unintuitive for users who naturally expect to place flags after the subcommand.
Changes:
- Added
--socks5and--connectflags to the send subcommand with identical definitions to the global flags - Both flag placements now work:
croc --socks5 X send file(existing) andcroc send --socks5 X file(new) - Environment variable support (
SOCKS5_PROXYandHTTP_PROXY) is maintained in both flag definitions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
Thanks |
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.
Description
This PR fixes issue #1051 where users expected to use
--socks5and--connectflags directly on thesendsubcommand, but these flags were only available as global flags.Changes
Added
--socks5and--connectflags to thesendsubcommand's flag list, allowing both syntaxes to work:croc --socks5 "127.0.0.1:9050" send file.txt(existing global flag - still works)croc send --socks5 "127.0.0.1:9050" file.txt(new, more intuitive syntax)Why
Users naturally expect flags to work when placed after the subcommand. The current implementation only supported the global flag syntax, which required flags before
send. While the README showed the correct syntax, this wasn't intuitive for users who are accustomed to specifying command-specific flags after the subcommand.The environment variables
SOCKS5_PROXYandHTTP_PROXYcontinue to work as fallbacks.Testing
The fix maintains backward compatibility:
Related Issue
Fixes #1051