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() {
|
||||
if test "$#" -ne 2; then
|
||||
printf "Usage: griddle <inputfile> <outputfile>\n"
|
||||
if test "$#" -ne 4; then
|
||||
printf "Usage: griddle <inputfile> <columns> <rows> <outputfile>\n"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
@ -25,7 +25,10 @@ main() {
|
|||
return 2
|
||||
fi
|
||||
|
||||
outputfile="$2"
|
||||
columns="$2"
|
||||
rows="$3"
|
||||
|
||||
outputfile="$4"
|
||||
if test -e "$outputfile"; then
|
||||
printf "Output file $outputfile already exists. Overwrite? (y/N) "
|
||||
read response
|
||||
|
@ -40,7 +43,7 @@ main() {
|
|||
width="$(get_image_dimension $inputfile $WIDTH)"
|
||||
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 "$@"
|
||||
|
|
Loading…
Reference in New Issue