Created
January 8, 2018 21:40
-
-
Save maximpertsov/463bef57a5dbdcb3a5728d1ca84a1afc to your computer and use it in GitHub Desktop.
Partially convert Django management commands from optparse style to argparse style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ag -l make_option | while read -r FILE; do cat $FILE | sed -i -e '/option_list/d' -e '/import make_option/d' -e 's/ make_option/parser.add_argument/g' -e 's/),\s*$/)/g' -e '0,/^\s*)\(,\|\)\s*$/{/^\s*)\(,\|\)\s*$/d}' -e '/args = "/d' $FILE; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment