From 26d0e38bec3ea7682ff6f6972674940af9918848 Mon Sep 17 00:00:00 2001 From: The Magician Date: Thu, 7 Mar 2024 13:35:02 +0000 Subject: [PATCH] Add columns and rows parameters --- griddle | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/griddle b/griddle index 5658899..900d8bd 100755 --- a/griddle +++ b/griddle @@ -14,8 +14,8 @@ get_image_dimension() { } main() { - if test "$#" -ne 2; then - printf "Usage: griddle \n" + if test "$#" -ne 4; then + printf "Usage: griddle \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 "$@"