0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Last updated at Posted at 2020-01-24

この記事は移行しました!最新の内容はこちらをご覧ください😀

引数にハッシュ値を指定する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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?