1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 08:17:35 +00:00

Base: Add some default completions to shellrc

This commit is contained in:
Ali Mohammad Pur 2022-04-12 03:30:02 +04:30 committed by Ali Mohammad Pur
parent 1699ddc186
commit 302a0c54f0
4 changed files with 111 additions and 1 deletions

View file

@ -0,0 +1,30 @@
#!/bin/Shell
__proxy() {
echo '{"kind":"proxy","argv":"'"${regex_replace '"' '\"' "$*"}"'"}'
}
# Builtins
_complete_time() {
shift 2
argsparser_parse \
--add-option _ --help-string "Number of iterations" \
--long-name iterations --short-name n --value-name iterations --type u32 \
--add-positional-argument argv --help-string _ \
--value-name _ --min 0 --max 9999999 \
--stop-on-first-non-option \
-- $*
__proxy $argv
}
# Utilities
_complete_pls() {
shift 2
argsparser_parse \
--add-option _ --help-string "User to execute as" --short-name u --value-name UID \
--add-positional-argument argv --help-string "Command to run at elevated privilege level" \
--value-name command --min 0 --max 999999 \
--stop-on-first-non-option \
-- $*
__proxy $argv
}