Created
April 14, 2024 05:08
-
-
Save ftnext/e5acaca5f49519e65961b6fc97f279f4 to your computer and use it in GitHub Desktop.
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
from optparse import OptionParser, make_option | |
option_list = [make_option("--no-cache-dir", action="store_true")] | |
parser = OptionParser(option_list=option_list) | |
options, args = parser.parse_args(["--no-cache-dir"]) | |
assert options.no_cache_dir | |
options2, args2 = parser.parse_args(["--no-cache"]) # "--no-cache-d"もOK | |
assert options2.no_cache_dir | |
options3, args3 = parser.parse_args([]) | |
assert not options3.no_cache_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment