assert-rs / completest

Run completions for your program
https://docs.rs/completest
Apache License 2.0
4 stars 6 forks source link

Clarify API/documentation #9

Open adaszko opened 1 year ago

adaszko commented 1 year ago

Continuing discussion at https://github.com/assert-rs/completest/issues/6#issuecomment-1658976859

The problem: By construing the home parameter as my actual $HOME directory, I accidentally overwrote the .zshenv file in it because completest creates a file of such a name there unconditionally. I think it’s a papercut that it would be nice to clarify.

The suggested solution:

  1. Deprecate/remove new() because more specific names tend to be more descriptive (IMO, of course).
  2. Rename “home” to “workdir” because it can be confused with an actual home directory and result in overwritten configuration files.
  3. Add a new constructor with_temp_workdir(bin_root) that creates a temporary workdir automatically.
  4. Probably also rename bin_root to something like shell_binary_dir_path.

EDIT: Clarify the problem.

epage commented 1 year ago

Rename “home” to “workdir” because it can be confused with an actual home directory and result in overwritten configuration files.

Except we are treating it as the home directory.

btw this is a list of proposed solutions without a description of the problem. In the future, please focus on the problem though you are welcome to provide suggested solutions. We just need to keep in mind the context of what we are working in and what the actual goal is.

adaszko commented 1 year ago

Rename “home” to “workdir” because it can be confused with an actual home directory and result in overwritten configuration files.

Except we are treating it as the home directory.

btw this is a list of proposed solutions without a description of the problem. In the future, please focus on the problem though you are welcome to provide suggested solutions. We just need to keep in mind the context of what we are working in and what the actual goal is.

The problem is that I accidentally obliterated my .zshenv. I thought that was clear from the previous issue:

https://github.com/assert-rs/completest/issues/6#issuecomment-1658976859:

Mind creating an issue on how we can clarify this?

In any case, I updated the issue description.