Closed masatake closed 2 years ago
Thanks a lot! Good Catch. I'll look into its details this weekend.
The fix you proposed may resolve a problem but IMHO, the CLI code itself is fragile and buggy and I don't want to apply your fixes now. Instead, I tried to clean up and re-organize its code in the branch named 'fix/cli-test-cases'.
It seems worked well and I'll try to apply changes after I confirmed that it works.
So, sorry but wait for a while, please.
FYI. I think that I could fix this and make sure it works with some test cases added in 22acbd1
It should be resolved in the latest version, 0.12.0.
$ rpm -q python3-anyconfig # It is available from my copr repo.
python3-anyconfig-0.12.0-1.fc34.noarch
$ cat << EOF > /tmp/foo.json
heredoc> {"a": 1}
heredoc> EOF
$ anyconfig_cli -o /tmp/foo.yml /tmp/foo.json
$ cat /tmp/foo.yml
a: 1
$
I tried the new version and I confirmed it worked fine. Thank you.
The refactoring done in a4a53ab900045b023777b06c160ea43197fe24d3 introduced unexpected side-effect. With the commit anyconfig lost the function to guess the output type from the output file name:
anyconfig_cli emits JSON output though YAML output guessed from 'foo.yml' is execpted,
Signed-off-by: Masatake YAMATO yamato@redhat.com