Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
document it, add error, remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaudill committed Oct 31, 2023
1 parent 6316f58 commit e509e29
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
3 changes: 3 additions & 0 deletions bin/ch-convert
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,9 @@ done
if [ "$#" -ne 2 ]; then
usage
fi
if [ $verbose -gt 0 ] && [ $quiet -gt 0 ]; then
FATAL "incompatible options: --quiet, --verbose"
fi
if [ -n "$no_xattrs" ]; then
tar_xattr_args=
squash_xattr_arg=
Expand Down
3 changes: 2 additions & 1 deletion doc/ch-convert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ producing the final format actually needed.
Output image format is :code:`FMT`; inferred if omitted.

:code:`-q`, :code:`--quiet`
Suppress program output. Note that this does not suppress errors.
Be quieter; can be repeated. Incompatible with :code:`-v`. See the :ref:`FAQ
entry on verbosity <faq_verbosity>` for details.

:code:`-s`, :code:`--storage DIR`
Set the storage directory. Equivalent to the same option for :code:`ch-image(1)`
Expand Down
18 changes: 0 additions & 18 deletions test/run/ch-convert.bats
Original file line number Diff line number Diff line change
Expand Up @@ -564,24 +564,6 @@ EOF
[[ $output = *"user:$USER:r--"* ]]
}


@test 'ch-convert: --quiet' {
printf 'FROM alpine:3.17\n' | ch-image build -t tmpimg -f - "$BATS_TMPDIR"

# successful convert
run ch-convert -q -i ch-image -o dir tmpimg "${BATS_TMPDIR}/tmpimg"
echo "$output"
[[ $status -eq 0 ]]
[[ -z "$output" ]]

# failed convert
run ch-convert -q -i dir -o dir "${BATS_TMPDIR}/tmpimg" "${BATS_TMPDIR}/tmpimg2"
echo "$output"
[[ $status -eq 1 ]]
[[ "$output" = *'error: input and output formats must be different'* ]]
}


@test 'ch-convert: dir -> ch-image -> X' {
test_from ch-image
}
Expand Down

0 comments on commit e509e29

Please sign in to comment.