Skip to content

Add usage_column and usage_width #121

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

A4-Tacks
Copy link

@A4-Tacks A4-Tacks commented Apr 9, 2025

Adjustable starting column and width of text is a good idea

Examples

Default:

Usage: pegview [-c] [-i NAME].. [-I NAME].. [-u] [-L] [--share-width STYLE] [-e] [-r] [-w] [-s] [-S SRC] [-q] [-C] [-h].. [--example] [-v] [FILES..]
Parse rust-peg traces, convert to tree

Options:
    -c, --center-rule   Rule name to centered
    -i, --ignore NAME   Ignore a rule
    -I, --ignore-partial NAME
                        Ignore a rule, support partial pattern
    -u, --unique-line   One rule one line
    -L, --last-width    Share width to last
        --share-width STYLE
                        Share width style (mixed, first, last)
    -e, --exclude-fails 
                        Exclude failed matches
    -r, --pair-fails    Add unpaired failed matches
    -w, --full-width-tab-chars 
                        Full-width tab chars
    -s, --fake-source   Using oneline fake source
    -S, --fake-source-from SRC
                        Using oneline fake source
    -q, --unquote-space 
                        Unquote space
    -C, --show-cached   Show cached match and fail
    -h, --help          Show help messages
        --example       Show example usage
    -v, --version       Show version

.set_usage_column(35):

Usage: pegview [-c] [-i NAME].. [-I NAME].. [-u] [-L] [--share-width STYLE] [-e] [-r] [-w] [-s] [-S SRC] [-q] [-C] [-h].. [--example] [-v] [FILES..]
Parse rust-peg traces, convert to tree

Options:
    -c, --center-rule              Rule name to centered
    -i, --ignore NAME              Ignore a rule
    -I, --ignore-partial NAME      Ignore a rule, support partial pattern
    -u, --unique-line              One rule one line
    -L, --last-width               Share width to last
        --share-width STYLE        Share width style (mixed, first, last)
    -e, --exclude-fails            Exclude failed matches
    -r, --pair-fails               Add unpaired failed matches
    -w, --full-width-tab-chars     Full-width tab chars
    -s, --fake-source              Using oneline fake source
    -S, --fake-source-from SRC     Using oneline fake source
    -q, --unquote-space            Unquote space
    -C, --show-cached              Show cached match and fail
    -h, --help                     Show help messages
        --example                  Show example usage
    -v, --version                  Show version

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.

1 participant