danielgtaylor / danielgtaylor/nesh

Suggestion: Implement a 'nesh profile' feature.

Open
#5 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
CoffeeScript
Stars
284
Forks
23
PR merge metrics
No merged PRs in 30d

Description

An invaluable feature of `nesh` is the ability to preload code into the REPL.

I've used this to set up a poor man's profile feature to preload a 'nesh profile' file into my `nesh` REPLs via aliases placed in my shell profile:

```
# CoffeeScript REPL
alias neshc='nesh -c -e ~/.nesh_profile.coffee'
# JavaScript REPL
alias neshj='nesh -e <(coffee -bp ~/.nesh_profile.coffee)'
```

A drawback of this approach is that I cannot load additional code in an _ad-hoc_ fashion by providing an additional `-e` option instance on the command line (this may be worth addressing separately: mixing files and strings with multiple `-e` instances currently doesn't work; with `-c` even multiple string-only `-e` instances break).

For convenience it would be great if `nesh` - analogous to shells and their profiles - preloaded such a file - required to have a prescribed name and location; e.g., `~/.nesh_profile.coffee` - automatically.
In cases where preloading is not desired, an option `--noprofile` (analogous to `bash`) could suppress it.

I suspect I could roll this feature myself with a plugin, but I wonder if it's of appeal to enough people to warrant making it part of `nesh` itself.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.