LoginSignup
0
0

More than 3 years have passed since last update.

artisanコマンドの引数にハイフン始まりの値を渡したい

Posted at

引数にハッシュ値を指定するartisanコマンドを作っていたのですが、
ハッシュ値がハイフン始まりのときにオプション扱いされてエラーになりました。。

現象

例)ハッシュ値が-LA12_ed

php artisan hoge:fuga -LA12_ed

エラーになる。The "-L" option does not exist.

対策

そんなときはエスケープすればいいよね。
エスケープ文字は -- でした。ハイフンハイフン半角スペース!

php artisan hoge:fuga -- -LA12_ed

これで無事引数を受け取れます。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0