Page MenuHomeSoftware Heritage

core.cli: Fix the create option as flag
ClosedPublic

Authored by ardumont on Dec 13 2018, 4:24 PM.

Details

Summary

Prior to this commit, unexpectedly the option was not a flag:

-C, --no-create TEXT  Do not attempt to create the database

So we would have had to pass along an extra boolean with the option.

Now it's simpler:

-c, --create / --no-create  Attempt to create the database
Test Plan

tox

Diff Detail

Repository
rDCORE Foundations and core functionalities
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3011
Build 3846: tox-on-jenkinsJenkins
Build 3845: arc lint + arc unit

Event Timeline

douardda added inline comments.
swh/core/cli.py
24–28

if you change the flag default value (thus meaning), use lower case short flag (here -c)

Makes no sense to keep it uppercase here.

Also the is_flag is not needed since you use the complete long version form for a flag '--create/--no-create'

This revision now requires changes to proceed.Dec 13 2018, 5:12 PM
  • core.cli: Use lower case short option and remove useless is_flag
ardumont retitled this revision from core.cli: Fix the create option as flag and keep original behavior to core.cli: Fix the create option as flag.Dec 13 2018, 5:16 PM
ardumont edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Dec 13 2018, 5:16 PM
This revision was automatically updated to reflect the committed changes.