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

Show invocable's help even without a config file #639

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

Javagedes
Copy link
Contributor

Enables the invocable to display it's command line arguments if -h or --help is provided, regardless of if it has a configuration file.

Examples

stuart_build

WARNING: Some command line arguments may be missing. Provide a platform module file to ensure all command line arguments are present.

usage: stuart_build [-h] [-c PLATFORM_MODULE]

options:
  -h, --help            show this help message and exit
  -c PLATFORM_MODULE, --platform_module PLATFORM_MODULE
                        Provide the Platform Module relative to the current working directory.This should contain a BuildSettingsManager instance.

stuart_ci_build

WARNING: Some command line arguments may be missing. Provide a platform module file to ensure all command line arguments are present.

usage: stuart_ci_build [-h] [-c PLATFORM_MODULE] [-p PACKAGELIST] [-a REQUESTED_ARCH] [-t REQUESTED_TARGET]

options:
  -h, --help            show this help message and exit
  -c PLATFORM_MODULE, --platform_module PLATFORM_MODULE
                        Provide the Platform Module relative to the current working directory.This should contain a CiBuildSettingsManager instance.
  -p PACKAGELIST, --pkg PACKAGELIST, --pkg-dir PACKAGELIST
                        Optional - A package or folder you want to update (workspace relative).Can list multiple by doing -p <pkg1>,<pkg2> or -p <pkg3> -p <pkg4>
  -a REQUESTED_ARCH, --arch REQUESTED_ARCH
                        Optional - CSV of architecture requested to update. Example: -a X64,AARCH64
  -t REQUESTED_TARGET, --target REQUESTED_TARGET
                        Optional - CSV of targets requested to update. Example: -t DEBUG,NOOPT

@Javagedes Javagedes added the enhancement New feature or request label Aug 30, 2023
@Javagedes Javagedes added this to the v0.24.1 milestone Aug 30, 2023
@Javagedes Javagedes self-assigned this Aug 30, 2023
@Javagedes Javagedes modified the milestones: v0.24.1, 0.24.2 Oct 2, 2023
@Javagedes Javagedes modified the milestones: 0.25.1, 0.25.2 Oct 20, 2023
@Javagedes Javagedes modified the milestones: 0.26.0, 0.26.1 Nov 6, 2023
@Javagedes Javagedes modified the milestones: 0.26.1, 0.26.3 Nov 13, 2023
Javagedes and others added 2 commits December 8, 2023 10:28
Enables the invocable to display it's command line arguments if `-h` or
`--help` is provided, regardless of if it has a configuration file.
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Merging #639 (eff180c) into master (c847f79) will decrease coverage by 0.10%.
The diff coverage is 12.50%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #639      +/-   ##
==========================================
- Coverage   78.83%   78.74%   -0.10%     
==========================================
  Files          49       49              
  Lines        4843     4850       +7     
==========================================
+ Hits         3818     3819       +1     
- Misses       1025     1031       +6     
Files Coverage Δ
...oolext/invocables/edk2_multipkg_aware_invocable.py 80.43% <ø> (ø)
edk2toolext/edk2_invocable.py 75.69% <12.50%> (-2.48%) ⬇️

@Javagedes Javagedes merged commit dc5b3cd into tianocore:master Dec 8, 2023
23 of 25 checks passed
@Javagedes Javagedes deleted the show-help branch December 8, 2023 18:58
Javagedes added a commit to Javagedes/edk2-pytool-extensions that referenced this pull request Dec 18, 2023
Changes made in tianocore#639 to ensure the invocable displayed their command
line arguments when a build module was not provided failed to test the
critical scenario of ensuring the help message was still displayed when
a build module was provided.

The help command line argument is consumed during the first pass of the
command line argument parser, so when the build module is found,
registered, and the parser is re-executed, the help argument is no
longer present to trigger the help message display.

This commit fixes the issue by adding the "--help" command line argument
to the arguments to be parsed if it was detected in the first parse.
Javagedes added a commit to Javagedes/edk2-pytool-extensions that referenced this pull request Dec 18, 2023
Changes made in tianocore#639 to ensure the invocable displayed their command
line arguments when a build module was not provided failed to test the
critical scenario of ensuring the help message was still displayed when
a build module was provided.

The help command line argument is consumed during the first pass of the
command line argument parser, so when the build module is found,
registered, and the parser is re-executed, the help argument is no
longer present to trigger the help message display.

This commit fixes the issue by adding the "--help" command line argument
to the arguments to be parsed if it was detected in the first parse.
Javagedes added a commit that referenced this pull request Dec 18, 2023
Changes made in #639 to ensure the invocable displayed their command
line arguments when a build module was not provided failed to test the
critical scenario of ensuring the help message was still displayed when
a build module was provided.

The help command line argument is consumed during the first pass of the
command line argument parser, so when the build module is found,
registered, and the parser is re-executed, the help argument is no
longer present to trigger the help message display.

This commit fixes the issue by adding the "--help" command line argument
to the arguments to be parsed if it was detected in the first parse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants