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

Refactor CLI Interface #137

Open
KCreate opened this issue Dec 31, 2016 · 4 comments
Open

Refactor CLI Interface #137

KCreate opened this issue Dec 31, 2016 · 4 comments
Labels
Milestone

Comments

@KCreate
Copy link
Collaborator

KCreate commented Dec 31, 2016

Remove the usage of the OptionParser and create a order-sensitive CLI interface.

See: https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/command.cr#L58

Commands should be:

charly # starts the REPL
charly repl # starts the REPL

charly file.ch # runs the file
charly run file.ch # runs the file
charly run repl # searches for a file called repl, doesn't invoke the built-in repl

# If there is a need for passing flags to the interpreter in run mode
# this should be the syntax:
charly run -Fmyflag -Fmyotherflag file.ch

charly tool # cli interface for tooling
charly tool dump # lists available things to dump
charly tool dump ast # asks for a filename
charly tool dump ast file.ch # dumps the ast for the file
charly tool dump tokens file.ch # dumps the tokens for the file
charly tool dump dot file.ch # dumps the dot language for the file

charly [-h, --help] # shows the help page
charly [-v, --version] # shows the version
charly --license # shows the license
@KCreate KCreate added the CLI label Dec 31, 2016
@KCreate KCreate modified the milestone: Release 0.4.0 Feb 11, 2017
@ghost
Copy link

ghost commented Apr 22, 2017

@KCreate Export the AST as Text or Image?

@KCreate
Copy link
Collaborator Author

KCreate commented Apr 22, 2017

@oltmannsdaniel This is already possible in the current version using the --ast option. This issue would put that option under charly tool dump ast file.ch

@ghost
Copy link

ghost commented Apr 22, 2017

Ah, ok. Sorry I read it wrong. Definitely better than now.

@KCreate
Copy link
Collaborator Author

KCreate commented Apr 22, 2017

Btw, this is how a textual AST dump looks like: https://pastebin.com/9wP678Hf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant