todotxt / todo.txt-cli

☑️ A simple and extensible shell script for managing your todo.txt file.
http://todotxt.org
GNU General Public License v3.0
5.55k stars 712 forks source link

Refactoring: Replace shellquote() with printf %q #380

Open inkarkat opened 2 years ago

inkarkat commented 2 years ago

I didn't know about printf's capability when I introduced quoting 10 years ago. The %q format will do the quoting, and -v VAR can be used to reassign to the variable.

Note: The shellquote() function has been exported for reuse by add-ons. I don't think anyone has ever used that (it was mostly intended for my own, extensive extensions, and I never used it), and is trivial to move away from, anyway.