Support `--eval` command line argument that evaluates one expression then exit

Open
#984 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Domain
cli

Research direction

Start by reading the Chez Scheme command-line option parsing and the existing --script and -q handling; the issue does not name specific files or tests. Define how --eval should interact with other options and errors, then add coverage for evaluating one expression and exiting. Done when the proposed command evaluates its expression and terminates as requested.

Written by the indexing model from the issue text.

Description

enhancement

I found it's quite helpful if Chez can provide such command line argument to run some quick command (especially in the packaging Chez related package)

chez-scheme --eval '(begin (compile-libraries ...))'

It may arguably that this can be done via

echo '(begin (compile-libraries ...))' | chez-scheme -q

(or just write your command to temporary file then execute it via chez-scheme --script)

However, support --eval command line argument is still useful for the use case that pipe(creating temporary file) is not reliable/not convenient.

I create this issue to request your comments, I'd like to try implement it and send a PR if there could be positive feedback

Dominant language
Scheme
Stars
7.4k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
19

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cisco/ChezScheme

All issues in cisco/ChezScheme

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.