lalbornoz / PuTTie

PuTTie loves you 💚
Other
52 stars 0 forks source link

Feature Request: Use the binary name to select the default storage backend #14

Closed lars18th closed 4 months ago

lars18th commented 4 months ago

Hi @lalbornoz ,

This fork of PuTTY looks very promising. The internal architecture has a very good design, with the best aim to keep it in parallel with the original code - that's very good!

But as to what useful modifications could be included in it, I want to put in my 5 cents. Before commenting on this let me explain that my idea is to suggest only things already evaluated as useful. And encourage to comment about them if they can be implemented in other, simpler ways… before proceeding to implement them. Better to save efforts on useful things, don't you think so?

Said that, I have this concrete suggestion:

IMHO, the use of PuTTY in a portable environment is a must have. Therefore, to simplify this use I propose a small change to improve the usability. The idea is to “Use the binary name to select the default storage backend”. The current implementation has three different storage backends (ephemeral, file, registry). And one of them is considered as default based on compiling parameters. The idea is to add new code to “replace at runtime” the default compiled backend selection, based on the name of the binary. Let me to explain it with concrete examples:

- "*-file.exe"      : enables "--file" parameter
- "*-ephemeral.exe" : enables "--ephemeral" parameter
- "*-registry.exe"  : (has sense if not compiled as default)
- "*-portable.exe"  : enables "--file=;~" parameter (one special case equivalent to "*-file.exe" with "--file=;~" as default)

And this will not override the current default selection when compiling. It just "has higher priority" than the default backend. In fact, it doesn't disables the parameters; because the user could continue using them (in this case the binary name doesn't have any impact). So the final and simple behaviour is that if the user changes the filename of any binary, then the default backend will be overridden.

I feel this is an elegant method to improve the portable mode. For example, in my use case, I will only need to rename putty.exe to putty-portable.exe regardless of the default backend of the binary.

What you think? I hope you want to consider this suggestion. Regards.

lars18th commented 4 months ago

Hi @lalbornoz ,

Impressive! Implemented exactly as requested, in a short time and very well implemented. Very good. 🥇

Thank you very much. 😃

lalbornoz commented 4 months ago

thank you!