I wanted to write a bash alias for the
git commit command. I typically use it like so:
git commit -m "my message here", so I wrote an alias like this:
alias commit='git commit'
which allows me to do this:
$ commit -m "My message"
However, then I thought I could also update my alias to remove the
-m option, getting me
$ commit "my message"
Then I thought, "Do I even need to type the quotes?" What I envisioned was this:
$ commit > My message here
> is the quote-continuation prompt you get when you are type enter in a quoted string:
$ git commit -m "I am about to hit the enter key >
And it completes the command when I hit enter.
Is there any way I can script this behavior in bash?
Bonus: the command aborts when I hit