← 피드로
I have long hated managing my custom scripts. I plop them in a bin/ dir, then I forget what scripts I have, what arguments they take, and have to sometimes ls ~/bin/ or even nvim ~/bin/script to see what they do.
So I made a tool called clh (for ‘Command Line Helper’) that organizes all the scripts for me, plus has some handy features.
To execute a custom script, you do: clh group/script_name, but you can clh bin a script and then call it directly from anywhere.
For an overview, here is the built-in help menu:
clh group/script [args] ... group "self" may be omitted
self -
alias - Assign an alias for a script/subscript.
bin - Create symlink in `bin/` dir pointing to target script.
edit - Create/Edit a script
globalize - Convert a group into a global callable script
help - Show help information
move - Move a clh script from source to dest
rm - Delete a script (CANNOT BE RECOVERED)
source - Convert a script to be loaded via `source` instead of being executed
Enter fullscreen mode Exit fullscreen mode
To get more info on a command, use clh help [group]/[subgroup].
추출 본문 · 출처: dev.to · https://dev.to/reedybear/cli-tool-for-organizing-your-own-scripts-on-linux-51h8