aspiers/stow

Clarify error message when `--target` directory doesn't exist

Open

#126 aberto em 22 de jan. de 2025

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Perl (51 forks)batch import
UXeasyhelp wanted

Métricas do repositório

Stars
 (1.013 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

The current error message if the --target directory doesn't exist looks like this:

stow: --target value '<path>' is not a valid directory

I personally found this wording to be quite confusing, and I actually ended up having to search the source code for the error to find what it actually meant. The phrasing "is not a valid directory" reads to me as "this is a directory, but you're not allowed to use it", not as "the target doesn't exist".

Additionally, having the full help print out in this error case makes it harder to see the error message at all.

I propose the following changes:

  1. Reword the error to be --target value '<path>' doesn't exist or is not a directory
  2. Don't automatically print the help if the --target is invalid

Guia do colaborador