We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getoptions を日頃より利用させてもらっております。開発者の皆様ありがとうございます。
以下のような ShellScript コードを作成し、 gengetoptions embed --overwrite を利用して、オプション解析のコードを追加した後実行すると、オプション -a のバックスラッシュが自動的にエスケープされるようです。
gengetoptions embed --overwrite
-a
# @getoptions parser_definition() { setup REST param a -a init:='\\' } # @end # @gengetoptions parser -i parser_definition parse # @end parse "$@" eval "set -- $REST" printf '%s\n' "$a"
直接 -a を指定するとエスケープされないようです。
$ sh a \ $ sh a -a '\\' \\
この動作はバグでしょうか。それとも仕様でしょうか。
当方の動作環境は以下のようになります。
$ getoptions -v v3.3.0 $ gengetoptions -v v3.3.0 $ dpkg -l | grep dash ii dash 0.5.8-2.10 i386 POSIX-compliant shell
The text was updated successfully, but these errors were encountered:
わたしは開発者ではありませんので仕様はわかりませんが、パラメーターに「バックスラッシュ バックスラッシュ」を渡しているのなら変数に「バックスラッシュ バックスラッシュ」がセットされるのは望ましい動作ではないでしょうか。
もしかして、単引用符と二重引用符の違いから「バックスラッシュ」を渡していると勘違いなさっているかもしれません。
$ printf "%s\n" "\\" '\\' \ \\
getoptions の init:= の方は、エスケープする必要があって注意が必要です。
init:=
Sorry, something went wrong.
No branches or pull requests
getoptions を日頃より利用させてもらっております。開発者の皆様ありがとうございます。
以下のような ShellScript コードを作成し、
gengetoptions embed --overwrite
を利用して、オプション解析のコードを追加した後実行すると、オプション-a
のバックスラッシュが自動的にエスケープされるようです。直接
-a
を指定するとエスケープされないようです。この動作はバグでしょうか。それとも仕様でしょうか。
当方の動作環境は以下のようになります。
The text was updated successfully, but these errors were encountered: