Some users accidentally remove their crontab by typing "crontab -r" when
they intend to edit it by "crontab -e". To prevent unrecoverable loss,
a wrapper function for the crontab command is now installed in the
sample yashrc.
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/yash/yash/trunk@4007
048f04df-13f5-43d7-8114-
9f9ceecaec24
* Line-editing no longer hangs when the terminfo database maps a
key to an empty string.
+ . Updated the sample initialization script (yashrc):
+ + A wrapper function for the "crontab" command is now installed
+ to prevent accidental removal by "crontab -r" where the user
+ intends "crontab -e".
. Updated completion scripts:
+ git-rebase: support new options in Git 2.24.0.
* terminfo データベースで何らかのキーが空文字列に対応させられて
いても行編集がフリーズしないようにした
+ . 初期化スクリプト (yashrc) のサンプルを更新:
+ + "crontab" コマンドのラッパー関数を追加し、"crontab -e" と打とう
+ としたときに誤って "crontab -r" でデータを消してしまうのを防ぐ
+ ようにした
. 補完スクリプトを更新:
+ git-rebase: Git 2.24.0 までの新しいオプションに対応
fi
+# avoid removing existing crontab by accident
+crontab()
+if [ -t 0 ] && (
+ for arg do
+ case "${arg}" in
+ (-*r*) exit;;
+ esac
+ done
+ false
+) then
+ printf 'crontab: seems you are trying to clear your crontab.\n' >&2
+ printf 'are you sure? (yes/no) ' >&2
+ case "$(head -n 1)" in
+ ([Yy]*) command crontab "$@";;
+ (*) printf 'crontab: cancelled.\n' >&2;;
+ esac
+else
+ command crontab "$@"
+fi
+
# an alias that opens a file
if command --identify xdg-open >/dev/null 2>&1; then
alias o='xdg-open'