|
|
@@ -1,16 +1,19 @@
|
|
|
#!/usr/bin/env bash
|
|
|
# open_scite.sh
|
|
|
# Usage:
|
|
|
-# ./open_scite.sh /path/to/file [line_number] [column_number]
|
|
|
+# ./open_scite.sh [/path/to/file] [line_number] [column_number]
|
|
|
+# If no path is provided, a new file named new_file.md is opened in the
|
|
|
+# current directory.
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
-if [[ $# -lt 1 || $# -gt 3 ]]; then
|
|
|
- echo "Usage: $0 <linux_path_to_file> [line_number] [column_number]"
|
|
|
+if [[ $# -gt 3 ]]; then
|
|
|
+ echo "Usage: $0 [linux_path_to_file] [line_number] [column_number]"
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
-FILE_LINUX="$1"
|
|
|
+DEFAULT_FILE="$PWD/new_file.md"
|
|
|
+FILE_LINUX="${1:-$DEFAULT_FILE}"
|
|
|
LINE="${2:-}"
|
|
|
COL="${3:-}"
|
|
|
|