Skip to content

File as parameter (Issue #11)#59

Open
gio8tisu wants to merge 9 commits into0k:masterfrom
gio8tisu:file-as-parameter
Open

File as parameter (Issue #11)#59
gio8tisu wants to merge 9 commits into0k:masterfrom
gio8tisu:file-as-parameter

Conversation

@gio8tisu
Copy link
Copy Markdown

@gio8tisu gio8tisu commented Aug 6, 2020

As requested in #11 and #13, added a new CLI option (--file) to read from a file instead of just standard input.
Personally, I would prefer it as a positional argument but i think it will conflict with the current interface.

In order to do it in a more "elegant" way, I have refactored the argument parsing to use python standard library's argparse module.
Then, added the new option which defaults to read from stdin and accepts a filename as value (and "-" as another way to read from stdin). Error handling for non-existing input file should probably be added.
Migrating to argparse causes an error for previously valid argument ordering. E.g., the following call is no longer valid:

cat <FILE> | shyaml get-value -y <KEY>

the valid call would be (notice the y-flag position):

cat test.yaml | shyaml -y get-valuekey

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 79.16667% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@91d229a). Learn more about missing BASE report.
⚠️ Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
shyaml.py 79.16% 4 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #59   +/-   ##
=========================================
  Coverage          ?   97.35%           
=========================================
  Files             ?        1           
  Lines             ?      227           
  Branches          ?       36           
=========================================
  Hits              ?      221           
  Misses            ?        5           
  Partials          ?        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants