I want to get user command exactly the way they typed. The only allowed difference is '
can come in place of "
and vice versa.
For example, if the user typed.
node test.js git commit -m "first message"
I want to log either of following on console.
You typed: git commit -m 'first message' //line A
You typed: git commit -m "first message" //line B
But there is not acceptable:
You typed: "git" "commit" "-m" "first message" //line C
You typed: 'git' 'commit' '-m' 'first message' // line D
As you can see above, quotes can be in different than the user provided ('
can replace "
and vice versa like in line B) but they can't be misplaced (like in line C and D). Hope this is clear.
Edit: Edited the whole question to avoid confusion.