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

Config with serde & ssh port #17

Merged
merged 7 commits into from
Apr 24, 2021
Merged

Conversation

TheAlgorythm
Copy link
Contributor

The configuration could look like this:

[remote]
host = "some-server"
user = "some-user"
ssh_port = 42
temp_dir = "~/some-dir"

All config options are optional. A check for having a host & user specified, either through cli or config, has to be implemented.
But an alternative could be to allow multiple remotes and picking either the first or one which was specified with a name in the cli (Information for myself: serde-piecewise-default has to be used).
I splitted the host and user into 2 separate entries but I could change that.

The changed command arguments are untested and derived from #13.

@TheAlgorythm TheAlgorythm marked this pull request as draft March 28, 2021 18:08
Copy link
Owner

@sgeisler sgeisler left a comment

Choose a reason for hiding this comment

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

Thx for the PR! It certainly makes the code base more idiomatic. I take from the WIP status that you are still working on it. I still left two comments.

@TheAlgorythm
Copy link
Contributor Author

TheAlgorythm commented Mar 31, 2021

Which configuration possibilities do you prefer?

@sgeisler
Copy link
Owner

Which configuration possibilities do you prefer?

I'm not sure I understand what you mean exactly. Ideally every option is available as both config file option and cmd line option.

But generally I have no strong feelings because I don't rely on the tool anymore. If you think a feature/option is useful and have a good argument in favor of it I'm happy to work on the PR with you and merging it eventually, but I'm not actively working on cargo-remote myself for now, so I have no roadmap or anything if that was part of the question. Rust has come a long way and I was clearly a beginner when I wrote cargo-remote, so there's probably enough to fix/do better.

@TheAlgorythm
Copy link
Contributor Author

What was the idea of an enum Opts with only one option. I changed it to a struct, as passing this opts around is easier. Is there any problem?
I hope I don't bother you.

@sgeisler
Copy link
Owner

sgeisler commented Apr 2, 2021

What was the idea of an enum Opts with only one option.

Iirc when cargo calls cargo-remote it called it with remote as first argument and I needed to get rid of it/match it somehow. Maybe there is a better workaround, have you tested this version?

I hope I don't bother you.

No, not at all, I'm happy someone finds the project useful enough to work on it 😃

@TheAlgorythm TheAlgorythm marked this pull request as ready for review April 8, 2021 15:34
@TheAlgorythm
Copy link
Contributor Author

How should we handle changes in the README?

@sgeisler
Copy link
Owner

At least remove wrong examples, but I'd appreciate it if there was some example config.

@TheAlgorythm
Copy link
Contributor Author

I think it is ready for merging. If you find any shortcomings please let me know.

@TheAlgorythm
Copy link
Contributor Author

Do you wait to merge until the next release to not confuse other people?

@sgeisler
Copy link
Owner

Sorry, I forgot about it a bit, will try to test and merge soon (kinda annoying since it's all manual).

@TheAlgorythm
Copy link
Contributor Author

Don't hurry

@sgeisler sgeisler merged commit 2a63be3 into sgeisler:master Apr 24, 2021
@sgeisler
Copy link
Owner

Merged 🎉 do you want me to cut a release?

@TheAlgorythm
Copy link
Contributor Author

It could be a release worth unless there are any changes planned. Btw the readme-field could be added to the Cargo.toml.

@sgeisler
Copy link
Owner

done

gui1117 pushed a commit to gui1117/cargo-remote that referenced this pull request Feb 4, 2025
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