Open bpbecker opened 1 year ago
I like the idea, but I think it needs to be more nuanced, as there are 4 possible scenarios:
I don't think an option is necessary. It is fine for user commands always to ask, and for API functions never to ask.
Yeah, I hadn't thought out all the scenarios - my posting the issue was a knee-jerk reaction to mistyping a directory name just now :).
We'd have to construct a prompt that handles cases 2-4 based on the non-existence of either the namespace, the directory, or both. It's a bit tedious, but doable...
I agree that the option isn't necessary for the user command case.
Currently when one enters:
]create # /some/directory/name
Link goes off and creates the directory if it doesn't exist (Link notifies you that the directory was created).If you've mistyped/misremembered the folder name, you then need to:
WIBNI by default Link confirmed that it should create the directory when used from a user command, using the Link API would not prompt by default. There could be a new switch or setting "confirm=1|0" or something like that so one could disable the prompt (or enable it when using the API). I think this is a sensible feature because you're almost always you're going to be Link'ing to an existing directory so if the directory doesn't exist, it's far more likely that you've mistyped the name than you actually want to create a new directory. A simple confirmation prompt 'Directory "/some/directory/name" does not exist, create it (Y/n)? ' is minimally intrusive and saves the frustration of having to clean up when you've mistyped the name.