Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add print & REPL functionality to CLI #267

Merged
merged 6 commits into from
Mar 8, 2020

Conversation

JohnDoneth
Copy link
Contributor

I believe this should close #142 and should make some progress towards #74.

If this PR (gets accepted / is satisfactory) I can continue working on other features needed to complete #74.

@jasonwilliams
Copy link
Member

Hey this looks great!

/// CLI configuration for Boa.
#[derive(Debug, StructOpt)]
#[structopt(author, about)]
struct Opt {
/// The javascript file to be evaluated.
#[structopt(name = "FILE", parse(from_os_str), default_value = "tests/js/test.js")]
#[structopt(name = "FILE", parse(from_os_str))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if i understand it by default boa_cli will now be a shell, and we need to pass the file if we want to keep the same functionality as before?
Im personally OK with that as it matches up with Node etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! It should be functionally equivalent. I just tested running node locally to check and passing no arguments (just calling node) opens an interactive shell.

files: Vec<PathBuf>,
/// Open a boa shell (WIP).
/// Open a boa shell.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this option make sense now that shell is the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now removed!

@jasonwilliams
Copy link
Member

Do you mind updating the readme and maybe docs/debugging.md so that new users know to pass a file?

Maybe show the argument boa takes or something like https://github.com/ogham/exa/blob/master/README.md#options or https://github.com/sharkdp/fd/blob/master/README.md#command-line-options

@jasonwilliams jasonwilliams merged commit d92da39 into boa-dev:master Mar 8, 2020
@JohnDoneth JohnDoneth deleted the printfn branch March 8, 2020 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Print() function
2 participants