ansible-lint icon indicating copy to clipboard operation
ansible-lint copied to clipboard

selecting profiles on the command-line requires "="

Open andreby opened this issue 3 years ago • 2 comments

Summary

Selecting profiles on the command-line doesn't work with "-P profile", only with "-P=profile".

This doesn't work:

ansible-lint -P basic test.yml
ansible-lint: error: argument -P/--profile: invalid choice: 'test.yml' (choose from 'min', 'basic', 'moderate', 'safety', 'shared', 'production')

This works:

ansible-lint -P=basic test.yml
Ansible and Ansible Lint details

ansible-lint 6.4.1.dev5 using ansible 2.13.2

andreby avatar Aug 08 '22 06:08 andreby

I am not sure if this can be fixed as it is cause by argparse getting confused, especially as we do allow no arguments for -P, which is the command for listing profiles.

ssbarnea avatar Aug 08 '22 10:08 ssbarnea

I used "-P profile" because that's what the examples in the documentation looked like. Just changing the documentation might be the easiest.

andreby avatar Aug 08 '22 11:08 andreby