-
Couldn't load subscription status.
- Fork 3k
Generalize flag handling #1976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize flag handling #1976
Changes from all commits
f442fd9
ee8a02c
52a7f64
43e036d
b98c8c1
e4c6bcd
c5ac2cf
18868ff
2fc4d64
91c45a7
c969a4c
053efc6
439d2e8
3276854
7e5deaa
d757f35
7b3ef21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| from tools.options import get_default_options_parser | ||
| from tools.build_api import get_config | ||
| from config import Config | ||
| from utils import argparse_filestring_type | ||
| try: | ||
| import tools.private_settings as ps | ||
| except: | ||
|
|
@@ -36,19 +37,15 @@ | |
| if __name__ == '__main__': | ||
| # Parse Options | ||
| parser = get_default_options_parser(add_clean=False, add_options=False) | ||
| parser.add_option("--source", dest="source_dir", | ||
| default=None, help="The source (input) directory", action="append") | ||
| parser.add_option("--prefix", dest="prefix", action="append", | ||
| default=None, help="Restrict listing to parameters that have this prefix") | ||
| parser.add_option("-v", "--verbose", action="store_true", dest="verbose", | ||
| parser.add_argument("--source", dest="source_dir", type=argparse_filestring_type, | ||
|
||
| default=[], help="The source (input) directory", nargs="*") | ||
| parser.add_argument("--prefix", dest="prefix", nargs="*", | ||
| default=[], help="Restrict listing to parameters that have this prefix") | ||
| parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", | ||
| default=False, help="Verbose diagnostic output") | ||
|
|
||
| (options, args) = parser.parse_args() | ||
| options = parser.parse_args() | ||
|
|
||
| for path in options.source_dir : | ||
| if not isdir(path) : | ||
| args_error(parser, "[ERROR] you passed \"{}\" to --source, which does not exist". | ||
| format(path)) | ||
| # Target | ||
| if options.mcu is None : | ||
| args_error(parser, "[ERROR] You should specify an MCU") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call is pulling in the following unneeded options:
-m,-t,-c <--clean, and-o <--options>. Perhaps this should just be a new instantiation of argparse?This should probably be in a separate PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a PR to fix this @bridadan ?