New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drafting over existing commands #5
Comments
Hmm... good point. I agree that silently overwriting the old definition is an error. I think draft should bail out. One approach might be to modify if type -a "$func" 2>/dev/null | grep -qE 'is.*alias|function'; then
printf '%s\n' "sorry, $(type -a "$func"). please choose another name."
return
fi That wouldn't prompt the user to revise, as you suggest, however. I need to think about that. If you're attempting to draft a command and use a name that's already taken, a revision probably isn't what you mean or want. If you said 'draft' in error and meant to say 'revise', then a reasonable expectation from a UX point of view would probably be that the command would fail and you'd type 'revise'. What do you think, would just bailing out suffice here? |
If there are to be two commands, then I agree, it should bail out. That said, I actually don't see the benefit in having two commands. You could potentially have a single |
I think, overall, that would be cleaner. I have become less enamored over time with my 'composition (writing) as metaphor for composition (programming)' theme, which is in part responsible for there being two commands, I've also wondered about the necessity of having two commands for Returning to your idea, I suppose that
|
Yes, exactly. It's too bad about the conflicts we must necessarily face in naming things since they're all globally namespaced. It might be worth considering for a future major release to make them all subcommands of something like |
I'll consider a command "suite" for a future release. I've always wanted to keep the porcelain footprint small, and command suites really shine when they namespace an expansive command set. Like you said, it may not be worth the major change. I'll need a few days to hack on the PRs welcome there, too, of course :) |
Thanks! I'd be happy to review it, if you want. |
sounds good! |
I think it's a problem that you can draft a command that already exists, and it just clobbers the old one without asking. At least it can be undone in git.
Do you think instead it ought to bail out with an error and suggest revise, ask if you want to overwrite or revise it, or just call
revise
instead?The text was updated successfully, but these errors were encountered: