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

Improve output when executing the help command #97

Merged
merged 6 commits into from
Sep 13, 2023

Conversation

ydah
Copy link
Collaborator

@ydah ydah commented Sep 12, 2023

This PR improve output when executing the help command.
In addition, add Options and OptionParser classes for refactoring.

Before

❯ bundle exec lrama --help               
Usage: lrama [options]
    -V, --version
    -S, --skeleton=FILE
    -t
    -h, --header=[FILE]
    -d
    -r, --report=THINGS
        --report-file=FILE
    -v
    -o, --output=FILE
        --trace=THINGS
    -e

After

❯ bundle exec lrama --help
Lrama is LALR (1) parser generator written by Ruby.

Usage: lrama [options] FILE

Tuning the Parser:
    -S, --skeleton=FILE              specify the skeleton to use
    -t                               reserved, do nothing

Output:
    -h, --header=[FILE]              also produce a header file named FILE
    -d                               also produce a header file
    -r, --report=THINGS              also produce details on the automaton
        --report-file=FILE           also produce details on the automaton output to a file named FILE
    -o, --output=FILE                leave output to FILE
        --trace=THINGS               also output trace logs at runtime
    -v                               reserved, do nothing

Error Recovery:
    -e                               enable error recovery

Other options:
    -V, --version                    output version information and exit
        --help                       display this help and exit

lib/lrama/option_parser.rb Outdated Show resolved Hide resolved
@ydah ydah requested a review from yui-knk September 13, 2023 02:43
@yui-knk yui-knk merged commit 8b4f420 into ruby:master Sep 13, 2023
11 checks passed
@yui-knk
Copy link
Collaborator

yui-knk commented Sep 13, 2023

Thanks for the great improvement!

@ydah ydah deleted the output-help-command branch September 13, 2023 03:41
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.

2 participants