-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Output flag #2452
Output flag #2452
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2452 +/- ##
==========================================
+ Coverage 84.66% 84.67% +0.01%
==========================================
Files 94 94
Lines 9446 9453 +7
Branches 2208 2209 +1
==========================================
+ Hits 7997 8004 +7
Misses 939 939
Partials 510 510 ☔ View full report in Codecov by Sentry. |
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.
I think this PR will read a lot cleaner if you use a single branch, and just select a file handle depending on the option. If -o
is set, set f
to args.output_path
. Otherwise, set it to sys.stdout
.
agreed, will do |
@charles-cooper changed the PR as you suggested. if two arguments for the flags are passed doesn't work well.
not really sure, in that case auto recognizing the format would be useful (write an abi and bin file separately). |
011aafd
to
a11b0a4
Compare
In order to avoid managing the resource manually (i.e. inserting calls to def cli_helper(f):
... and then you would do something like if args.output_path:
with open(...) as f:
cli_helper(f)
else:
cli_helper(f) |
Also, please use |
@charles-cooper updated. I added end="" so that the output does not end with newline. |
I think we can accept this PR but without the |
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.
Final nit: (style guide: functions private to a module should be prefixed with _
)
Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
What I did
add the flag "-o" to generate output files. this will write abi, bin and combined files. other options like ast, lll, opcodes need to be handled separately.
How I did it
add a flag to argparser and write the files
How to verify it
Description for the changelog