Skip to content
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

allow --ssh-opts starts with hyphen #277

Merged
merged 2 commits into from
Jun 10, 2024
Merged

allow --ssh-opts starts with hyphen #277

merged 2 commits into from
Jun 10, 2024

Conversation

Anillc
Copy link
Contributor

@Anillc Anillc commented Jun 8, 2024

for example

deploy .#s --hostname example.com --ssh-opts '-p 1145'

without allow_hyphen_values:

error: Found argument '-p' which wasn't expected, or isn't valid in this context

workaround: add a space after quote

deploy .#s --hostname example.com --ssh-opts ' -p 1145'

but it might be better adding allow_hyphen_values = true

@rvem
Copy link
Member

rvem commented Jun 10, 2024

Hmm, I'm a bit confused since I don't have this issue when using --ssh-opts '-p <smth> locally.
I'm using deploy-rs from 88b3059. Which revision are you using?

@rvem
Copy link
Member

rvem commented Jun 10, 2024

Also, I don't think --ssh_opts is a correct option:

error: Found argument '--ssh_opts' which wasn't expected, or isn't valid in this context

	Did you mean '--ssh-opts'?

If you tried to supply `--ssh_opts` as a PATTERN use `-- --ssh_opts`

@Anillc
Copy link
Contributor Author

Anillc commented Jun 10, 2024

I'm at b3ea6f3

I have tested 88b3059. The result is the same

here is the log

image

@Anillc
Copy link
Contributor Author

Anillc commented Jun 10, 2024

Also, I don't think --ssh_opts is a correct option:

error: Found argument '--ssh_opts' which wasn't expected, or isn't valid in this context

	Did you mean '--ssh-opts'?

If you tried to supply `--ssh_opts` as a PATTERN use `-- --ssh_opts`

sorry, It's my typo

@Anillc Anillc changed the title allow ssh_opts starts with hyphen allow ssh-opts starts with hyphen Jun 10, 2024
@Anillc Anillc changed the title allow ssh-opts starts with hyphen allow --ssh-opts starts with hyphen Jun 10, 2024
@rvem
Copy link
Member

rvem commented Jun 10, 2024

Oh, right --ssh-opts='-p 1234' works, --ssh-opts '-p 1234 doesn't (note the absence of =)

@rvem
Copy link
Member

rvem commented Jun 10, 2024

It'd also be nice to add a regression test for this. Something like

diff --git a/nix/tests/default.nix b/nix/tests/default.nix
index b38e99d..3339f89 100644
--- a/nix/tests/default.nix
+++ b/nix/tests/default.nix
@@ -131,4 +131,9 @@ in {
     user = "deploy";
     deployArgs = "-s .#profile -- --offline";
   };
+  hyphen-ssh-opts-regression = mkTest {
+    name = "profile";
+    user = "deploy";
+    deployArgs = "-s .#profile --ssh-opts '-p 22' -- --offline";
+  };
 }

will do

nix/tests/default.nix Outdated Show resolved Hide resolved
Copy link
Member

@rvem rvem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks for the contribution!

@rvem rvem merged commit 9c31476 into serokell:master Jun 10, 2024
7 checks passed
@Anillc Anillc deleted the patch-1 branch June 10, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants