Bird
0
0

Which method is used to add a new command to a Flask CLI group when using the command pattern?

easy📝 Conceptual Q2 of 15
Flask - Ecosystem and Patterns
Which method is used to add a new command to a Flask CLI group when using the command pattern?
Aadd_command()
Bregister_command()
Cappend_command()
Dinclude_command()
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct method

    The Flask CLI uses the add_command() method to add new commands to a CLI group.
  2. Step 2: Eliminate incorrect options

    Methods like register_command(), append_command(), and include_command() are not part of Flask CLI's API.
  3. Final Answer:

    add_command() -> Option A
  4. Quick Check:

    Method to add CLI command = add_command() [OK]
Quick Trick: Use add_command() to attach commands to CLI groups [OK]
Common Mistakes:
MISTAKES
  • Using non-existent methods like register_command
  • Confusing with list methods like append
  • Assuming include_command exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes