mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 13:24:03 +00:00
15 lines
No EOL
658 B
Markdown
15 lines
No EOL
658 B
Markdown
---
|
||
title: 'Improve the DX of your commands by making arguments optional and prompting the user when they''re empty'
|
||
tweet_id: '1515057387027140609'
|
||
thread_slug: weekly-thread-2022-15
|
||
author_username: mmartin_joo
|
||
images:
|
||
- 'https://pbs.twimg.com/media/FQAcwOkWUAESOwS.jpg'
|
||
created_at: 2022-04-15T20:00:04+00:00
|
||
slug: improve-the-dx-of-your-commands-by-making-arguments-optional-and-prompting-the-user-when-theyre-empty
|
||
---
|
||
💡 Just a quick tip: define every argument of commands as optional and ask for input if they are missing.
|
||
|
||
This way, you don’t need to think about the arguments when running a command.
|
||
|
||
Just run it, and it will ask everything: |