Parse CLI args

This commit is contained in:
The Magician 2024-03-07 12:50:00 +00:00
parent 4f2d8bbc26
commit 56578bdc3e
1 changed files with 13 additions and 1 deletions

14
griddle Normal file → Executable file
View File

@ -1,3 +1,15 @@
#!/bin/sh
echo "Hello, world"
main() {
if test "$#" -ne 2; then
echo "Usage: griddle <inputfile> <outputfile>"
return 1
fi
inputfile="$1"
outputfile="$2"
echo "$inputfile" "$outputfile"
}
main "$@"