chipsenkbeil / distant

🚧 (Alpha stage software) Library and tooling that supports remote filesystem and process operations. 🚧
https://distant.dev
578 stars 12 forks source link

fix(parser): allow `-` (hyphen) to appear in usernames #203

Closed westernwontons closed 1 year ago

westernwontons commented 1 year ago

Fixes #197

Usernames may contains hyphens now. Examples:

some-user, -some-user, some-user-

Further solutions

Introduce regex to deal with parsing the input into a Destination. On one hand, it has the potential to make the code simpler. On the other hand, it's a dependency on the regex crate.

chipsenkbeil commented 1 year ago

@westernwontons this project has a lot of dependencies, and in fact we use regex in the distant-core crate right now: https://github.com/chipsenkbeil/distant/blob/4fb9045152ead6cbdee87f8cd67d9081ff765b0d/distant-core/Cargo.toml#L27

So I'm not opposed to using it, but it's a case of "don't fix what's not broken." So unless the regex fixes a bunch of issues or speeds up performance, I'm not necessarily inclined to introduce it right now. Open for discussion, though!

chipsenkbeil commented 1 year ago

@westernwontons can you update the changelog with your fix?

westernwontons commented 1 year ago

@westernwontons can you update the changelog with your fix?

absolutely

westernwontons commented 1 year ago

@westernwontons this project has a lot of dependencies, and in fact we use regex in the distant-core crate right now:

https://github.com/chipsenkbeil/distant/blob/4fb9045152ead6cbdee87f8cd67d9081ff765b0d/distant-core/Cargo.toml#L27

So I'm not opposed to using it, but it's a case of "don't fix what's not broken." So unless the regex fixes a bunch of issues or speeds up performance, I'm not necessarily inclined to introduce it right now. Open for discussion, though!

I very much agree with you, I was mentioning it as an alternative in the future if it might become necessary