Add "lua" as an alias for "#!lua" ##lang

This commit is contained in:
pancake 2022-12-02 14:55:42 +01:00
parent 3b033951be
commit 3cf4f66811
2 changed files with 14 additions and 1 deletions

View File

@ -77,6 +77,7 @@ static RCoreHelpMessage help_msg_dollar = {
static RCoreHelpMessage help_msg_l = {
"Usage:", "l[erls] [arg]", "Internal less (~..) and file listing (!ls)",
"lu", " [path]", "same as #!lua",
"ll", " [path]", "same as ls -l",
"lr", " [path]", "same as ls -r",
"ls", " [-e,-l,-j,-q] [path]", "list files in current or given directory",
@ -1511,6 +1512,18 @@ static int cmd_l(void *data, const char *input) { // "l"
}
cmd_lr (core, arg);
break;
case 'u': // "lu"(a) - short for #!lua
{
const char *arg = strchr (input, ' ');
if (arg) {
char *cmd = r_str_newf ("#!lua %s", r_str_trim_head_ro (arg + 1));
r_core_cmd0 (core, cmd);
free (cmd);
} else {
r_core_cmd0 (core, "#!lua");
}
}
break;
case 's': // "ls"
if (input[1] == '?') {
r_core_cmd_help_match (core, help_msg_l, "ls", true);

View File

@ -2751,7 +2751,7 @@ static void __init_autocomplete_default(RCore* core) {
".", "..", ".*", "/F", "/m", "!", "!!", "#!c", "#!v", "#!cpipe", "#!qjs", "#!tiny", "#!vala", "v.",
"#!rust", "#!zig", "#!pipe", "#!python", "aeli", "arp", "arpg", "dmd", "drp", "drpg", "oe", "ot", "o+", "o++", "on", "o",
"idp", "idpi", "L", "obf", "o+", "oc", "of", "r2", "rabin2", "rasm2", "rahash2", "rax2",
"rafind2", "cd", "ls", "on", "wf", "rm", "wF", "wp", "Sd", "Sl", "to", "pm",
"rafind2", "cd", "ls", "lua", "on", "wf", "rm", "wF", "wp", "Sd", "Sl", "to", "pm",
"/m", "zos", "zfd", "zfs", "zfz", "cat", "wta", "wtf", "wxf", "dml", "dd", "dd+",
"vi", "vim", "nvi", "neovim", "nvim", "nano",
#if __WINDOWS__