Add input validation - the script only supports editing a single file
This commit is contained in:
parent
888434d5d9
commit
4cfa7ed76b
1 changed files with 6 additions and 0 deletions
|
|
@ -54,6 +54,12 @@ clean_tempfiles() {
|
|||
rm --force "${tempfile}" "${tempfile}.orig"
|
||||
}
|
||||
|
||||
if [ "$#" -ne "1" ]; then
|
||||
echo "Expected exactly one input file. Usage:" 1>&2
|
||||
echo " $0 FILE" 1>&2
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
editor_cmd="$(default_editor)"
|
||||
echo "Editing using the command \"${editor_cmd}\""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue