Add columns and rows parameters
This commit is contained in:
parent
c5be149197
commit
26d0e38bec
11
griddle
11
griddle
|
@ -14,8 +14,8 @@ get_image_dimension() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if test "$#" -ne 2; then
|
if test "$#" -ne 4; then
|
||||||
printf "Usage: griddle <inputfile> <outputfile>\n"
|
printf "Usage: griddle <inputfile> <columns> <rows> <outputfile>\n"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -25,7 +25,10 @@ main() {
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
outputfile="$2"
|
columns="$2"
|
||||||
|
rows="$3"
|
||||||
|
|
||||||
|
outputfile="$4"
|
||||||
if test -e "$outputfile"; then
|
if test -e "$outputfile"; then
|
||||||
printf "Output file $outputfile already exists. Overwrite? (y/N) "
|
printf "Output file $outputfile already exists. Overwrite? (y/N) "
|
||||||
read response
|
read response
|
||||||
|
@ -40,7 +43,7 @@ main() {
|
||||||
width="$(get_image_dimension $inputfile $WIDTH)"
|
width="$(get_image_dimension $inputfile $WIDTH)"
|
||||||
height="$(get_image_dimension $inputfile $HEIGHT)"
|
height="$(get_image_dimension $inputfile $HEIGHT)"
|
||||||
|
|
||||||
echo "$inputfile" "$outputfile" "Dimensions: $width x $height"
|
echo "$inputfile" "columns: $columns" "rows: $rows" "$outputfile" "Dimensions: $width x $height"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
Loading…
Reference in New Issue