-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change CLI messages to use CROC_SECRET #759
Conversation
Also removed unnecessary quotes
Not sure if CROC_SECRET works on all platforms though (windows?) |
src/croc/croc.go
Outdated
@@ -646,7 +646,7 @@ func (c *Client) Send(filesInfo []FileInfo, emptyFoldersToTransfer []FileInfo, t | |||
if c.Options.RelayPassword != models.DEFAULT_PASSPHRASE { | |||
flags.WriteString("--pass " + c.Options.RelayPassword + " ") | |||
} | |||
fmt.Fprintf(os.Stderr, "Code is: %[1]s\nOn the other computer run\n\ncroc %[2]s%[1]s\n", c.Options.SharedSecret, flags.String()) | |||
fmt.Fprintf(os.Stderr, "Code is: %[1]s\nOn the other computer run\n\nCROC_SECRET=%[1]s croc %[2]s\n", c.Options.SharedSecret, flags.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessary on Windows. Can you change it to only print this on Unix systems (you can use runtime.GOOS == "windows"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The receiver system may not be the same as the sender. I changed this to print both commands.
CROC_SECRET is not needed on Windows, so please keep the regular print statements for Windows systems (if |
@01-1 does the suggested change make sense? |
No, it doesn't - as per my comment, the receiver system may not be the same as the sender. For example, a windows system could send a file to a unix system, and vice versa. |
I think its best to revert line 649 back to original. The receiver should interact with the messages |
It doesn't make sense to tell the user to run a command that will not work by default. |
I think we can all agree that no one agrees on user interaction. to me, the interaction makes sense because you type in
versus having to have that information in the sender's purview also. |
OK. It is much easier to be able to copy-paste the command though. Maybe add an option to print the unix command? |
I mean, its pretty easy just to type |
Hi. I arrived here because I wanted to propose a similar change. I believe a workflow that easily and quickly lets you do the right thing is valuable as it reduces the amount of frustation of anyone involved. However I think the proposed message is hard to read, I would prefer something like:
Code would be
|
@nhtzr please submit a PR! |
This pull request changes the cli messages to use CROC_SECRET.
Previously, the error message used export CROC_SECRET, which is unnecessary as you can just run
CROC_SECRET=**** croc
in one line.Also, the messages for the sender used the classic command:
This made it incompatible with UNIX unless classic mode was activated.
The new command is
I also fixed a typo in the cli error messages.