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

fix: Print the long options of the required flags missing #1126

Merged
merged 2 commits into from
May 2, 2020

Commits on May 2, 2020

  1. test(context): Added regression test for requiredFlagsError

    This adds a test verifying that the requiredFlagsError does contain the long
    option of the missing flag, instead of the short option and a space, which was
    the old behaviour.
    
    Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
    Ole Petter committed May 2, 2020
    Configuration menu
    Copy the full SHA
    f842187 View commit details
    Browse the repository at this point in the history
  2. fix: Print the long options of the required flags missing

    The error message collected by 'checkRequiredFlags()' now sets the name of the flags
    to the long option given in the 'Name: <somecommand>' field.
    
    This change is introduced to fix up an error where printing the error in the
    case of a missing required flag looks like:
    
    ```
    Required flags " n,  t" not set
    ```
    
    Whilst the expected behaviour is:
    
    ```
    Required flags "<long-name1>, <long-name2>" not set
    ```
    
    Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
    Ole Petter committed May 2, 2020
    Configuration menu
    Copy the full SHA
    ee2fae6 View commit details
    Browse the repository at this point in the history