论坛: 一般話題(質疑・要望等) (Thread #43809)

GREPモードのコマンドラインオプション (2021-03-12 09:14 by Kazu #87156)

-GOPT=SPW1KGU とした場合、Gが無視されるようですが、指定の仕方が悪いのでしょうか?

回复到 #87156×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

Re: GREPモードのコマンドラインオプション (2021-03-12 18:52 by AC #87157)

ほんとですね。次のようなコマンドでテストしましたが、G オプションも F オプションも B オプションもダイアログに反映されませんでした。

> sakura2320.exe -GREPMODE -GREPDLG -GOPT=FBGD

しかし次のようにダイアログなしで直に実行した場合は、それぞれのオプションに対応してか GREP 出力に変化がありました。

> sakura2320.exe -GREPMODE -GFILE="*.*" -GFOLDER="." -GKEY=A -GOPT=FBGD

------------------------------------

ここからは興味がある場合にだけお読みください。

https://github.com/sakura-editor/sakura/blame/f486956cdb0d2e64a142c64fe7b4eeeaeceb7971/sakura_core/_main/CCommandLine.cpp#L475

2013 年に「New: Grep拡張」として追加された機能と、それに対応したコマンドラインオプションが -GOPT=FBG だったようです。ヘルプ(https://sakura-editor.github.io/help/HLP000109.html)には FBG で記載されていますが、コードでは FBD となっており、G オプションに対応するコードは見あたりませんでした。

https://github.com/sakura-editor/sakura/blame/f486956cdb0d2e64a142c64fe7b4eeeaeceb7971/sakura_core/_main/CNormalProcess.cpp#L221

同じ「New: Grep拡張」コミットによって、追加されたコマンドラインオプションが GREP に渡されていますが、これは「if( !bGrepDlg ){」で囲まれているのでダイアログを表示しないケースに限られた対応です。つづく else 節で新オプションを GREP ダイアログに反映させるためのコードが必要なはずですが、ないのかもしれません。よく見ていません。
回复到 #87156

回复到 #87157×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录