HomeSetup Developer Handbook
Standard-Tools
Table of contents
Command tool
__hhs_command
usage: __hhs_command [options [cmd_alias] <cmd_expression>] | [cmd_index]
Options:
[cmd_index] : Execute the command specified by the command index.
-e | --edit : Edit the commands file.
-a | --add : Store a command.
-r | --remove : Remove a command.
-l | --list : List all stored commands.
Notes:
MSelect default : When no arguments is provided, a menu with options will be displayed.
Purpose:
Add/Remove/List/Execute saved bash commands.
Returns:
0 if the command executed successfully; non-zero otherwise.
Parameters:
- $1 Optional : The command index or alias.
- $2..$N Conditional : The command expression. This is required when alias is provided.
Examples:
__hhs_command -a test ls -la
Output
Command stored: "TEST" as ls -la
__hhs_command test
Output
#> ls -la
rwxr-xr-x 37 hjunior staff 1 KiB Tue Dec 26 17:31:35 2023 ./
rwx------ 9 hjunior staff 288 B Thu Dec 21 19:06:11 2023 ../
rwxr-xr-x 14 hjunior staff 448 B Fri Dec 22 19:10:05 2023 backup/
rwxr-xr-x 18 hjunior staff 576 B Fri Dec 22 18:56:47 2023 bin/
rwxr-xr-x 3 hjunior staff 96 B Tue Dec 26 16:39:48 2023 cache/
rwxr-xr-x 5 hjunior staff 160 B Tue Dec 26 15:21:18 2023 log/
rwxr-xr-x 3 hjunior staff 96 B Mon Dec 18 15:24:45 2023 motd/
...
...
__hhs_command -r test
Output
Command removed: "TEST"