1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/improve-the-dx-of-your-commands-by-making-arguments-optional-and-prompting-the-user-when-theyre-empty.md
2022-04-17 20:03:34 +02:00

15 lines
No EOL
658 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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 dont need to think about the arguments when running a command.
Just run it, and it will ask everything: