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

Modified behavior of --help/-h and added commands -H/--help--all #1568

Merged
merged 13 commits into from
Jul 27, 2023

Conversation

Mendi03
Copy link
Collaborator

@Mendi03 Mendi03 commented Jul 19, 2023

Closes #1453

  • Changed the behavior of --help / -h. Some subcommands and there respective help messages were removed since they are only used for development purposes, it will now only show less subcommands.
  • Added the subcommand --help-all / -H, which will now do what --help did before. It will show all subcommands and their help message.

Output of -h and --help:

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -c CONFIGFILE, --config CONFIGFILE
                        Specify Path to Configuration File
  -d, --debug           Stream log messages to stdout
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Filter log messages based on logging level
  --editor {vi,vim,emacs,nano}
                        Select your preferred editor when opening files.
  --view-log            Show content of last log
  --logpath             Print full path to last log file
  --print-log           Print content of last log without pagination
  --color COLOR         Print output of table with the selected color.
  --no-color            Disable colored output
  --helpcolor           Print available color options in a table format.
  -r REPORT, --report REPORT
                        Specify path to test report file
  -H, --help--all       Show help for all commands

COMMANDS:
  
    build (bd)          Build and Run test
    buildspec (bc)      Buildspec Interface
    config (cg)         Query buildtest configuration
    report (rt)         Query test report
    inspect (it)        Inspect a test based on NAME or ID
    path                Show path attributes for a given test
    history (hy)        Query build history
    schema              List schema contents and examples
    cdash               Upload test to CDASH server
    cd                  change directory to root of test given a test name
    clean               Remove all generate files from buildtest including test directory, log files, report file, buildspec cache, history files.
    debugreport (debug)
                        Display system information and additional information for debugging purposes.
    stats               Show test statistics for given test
    info                Show details regarding current buildtest setup
    show (s)            buildtest command guide

Output of -H and --help-all

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -c CONFIGFILE, --config CONFIGFILE
                        Specify Path to Configuration File
  -d, --debug           Stream log messages to stdout
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Filter log messages based on logging level
  --editor {vi,vim,emacs,nano}
                        Select your preferred editor when opening files.
  --view-log            Show content of last log
  --logpath             Print full path to last log file
  --print-log           Print content of last log without pagination
  --color COLOR         Print output of table with the selected color.
  --no-color            Disable colored output
  --helpcolor           Print available color options in a table format.
  -r REPORT, --report REPORT
                        Specify path to test report file
  -H, --help--all       Show help for all commands

COMMANDS:
  
    build (bd)          Build and Run test
    buildspec (bc)      Buildspec Interface
    config (cg)         Query buildtest configuration
    report (rt)         Query test report
    inspect (it)        Inspect a test based on NAME or ID
    path                Show path attributes for a given test
    history (hy)        Query build history
    schema              List schema contents and examples
    cdash               Upload test to CDASH server
    unittests (test)    Run buildtest unit tests
    stylecheck (style)  Run buildtest style checks
    cd                  change directory to root of test given a test name
    clean               Remove all generate files from buildtest including test directory, log files, report file, buildspec cache, history files.
    schemadocs          Open buildtest schema docs in browser
    docs                Open buildtest docs in browser
    debugreport (debug)
                        Display system information and additional information for debugging purposes.
    stats               Show test statistics for given test
    info                Show details regarding current buildtest setup
    show (s)            buildtest command guide
    tutorial-examples   Generate documentation examples for Buildtest Tutorial

@Mendi03 Mendi03 added the new feature New Feature in buildtest such as command line or improvement to buildspec label Jul 19, 2023
@Mendi03 Mendi03 self-assigned this Jul 19, 2023
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Patch coverage: 62.50% and project coverage change: -0.06% ⚠️

Comparison is base (d256828) 78.39% compared to head (b33d6db) 78.34%.
Report is 14 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #1568      +/-   ##
==========================================
- Coverage   78.39%   78.34%   -0.06%     
==========================================
  Files          56       56              
  Lines        6558     6569      +11     
==========================================
+ Hits         5141     5146       +5     
- Misses       1417     1423       +6     
Files Changed Coverage Δ
buildtest/cli/__init__.py 98.18% <62.50%> (-1.82%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

bash_completion.sh Outdated Show resolved Hide resolved
@Mendi03
Copy link
Collaborator Author

Mendi03 commented Jul 20, 2023

Should I add coverage for the init file?

bash_completion.sh Outdated Show resolved Hide resolved
Mendi03 and others added 2 commits July 24, 2023 14:09
wrote the method to avoid having redundant if/else statement when trying to display hidden help messages
@Mendi03
Copy link
Collaborator Author

Mendi03 commented Jul 24, 2023

Just pushed a commit based on the feedback from the review.

changes based on feedback
Copy link
Member

@shahzebsiddiqui shahzebsiddiqui left a comment

Choose a reason for hiding this comment

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

@Mendi03 this looks good. Thanks for adding support for this feature!

@shahzebsiddiqui shahzebsiddiqui merged commit eeae018 into buildtesters:devel Jul 27, 2023
26 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New Feature in buildtest such as command line or improvement to buildspec size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: an option to show all subcommands --help-all
2 participants