facebookarchive / codemod

Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention. Codemod was developed at Facebook and released as open source.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage should indicate that one of '--extensions' and '--include-extensionless' is required

DanielHeath opened this issue · comments

Currently, if I run codemod.py foo bar, I get the following:

usage: codemod.py [-h] [-m] [-d D] [-i] [--start START] [--end END]
                  [--extensions EXTENSIONS] [--include-extensionless]
                  [--exclude-paths EXCLUDE_PATHS] [--accept-all]
                  [--editor EDITOR] [--count] [--test]
                  [match] [subst]

In most utilities I've used, the usage string does not use square brackets around required parameters.

The brackets will be removed if the argument is set to required=True but there is no way to specify that one of two arguments is required. Instead the way in which extension passing is handled needs to be changed to do this.

Yep - just something I found a little confusing when figuring out the options.

+1. Or it could just scan all file extensions by default.