Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
* fix(lisp): Report error only inside the command's execution ([#389](../../pull/389))
* fix: Correct entry file name to `eask.js` instead of `eask` ([#397](../../pull/397))
* fix: Ensure that `eask.js` has Unix line-endings ([#398](../../pull/398))
* fix: Correctly parse operands from the command arguments ([#401](../../pull/401))

## 0.12.x
> Released Dec 02, 2025
Expand Down
2 changes: 1 addition & 1 deletion cmds/core/emacs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports.handler = async (argv) => {
let s_path = UTIL.el_script('core/emacs');

let default_cmd = [EASK_EMACS, '-Q', '-l', s_path];
let rest = process.argv.slice(3);
let rest = UTIL.take_after(process.argv, EASK_EMACS);
let cmd = default_cmd.concat(rest);

UTIL.setup_env();
Expand Down
2 changes: 1 addition & 1 deletion cmds/core/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports.builder = async (yargs) => {
};

exports.handler = async (argv) => {
let cmd = process.argv.slice(3);
let cmd = UTIL.take_after(process.argv, 'exec');

await UTIL.e_call(argv, 'core/exec', '--', cmd);

Expand Down
11 changes: 11 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ function escape_str(str) {
return str.replaceAll('\"', '\\"');
}

/**
* Return arguments after matching string.
*/
function take_after(arr, str) {
let index = arr.indexOf(str);
if (index === -1)
return arr;
return arr.slice(index + 1);
}

/**
* Return arguments after `--` in list.
*/
Expand Down Expand Up @@ -300,6 +310,7 @@ module.exports.which = which;
module.exports.slash = slash;

module.exports.escape_str = escape_str;
module.exports.take_after = take_after;
module.exports.cli_args = cli_args;
module.exports.plugin_dir = plugin_dir;
module.exports.def_flag = def_flag;
Expand Down