| 1 | How do you create a basic command-line argument parser using argparse? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Beginner |
| 2 | What is the difference between a positional argument and an optional argument (flag) in argparse? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Beginner |
| 3 | How do you specify a default value and a type conversion for an argument? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Intermediate |
| 4 | How do you restrict an argument's accepted values using the 'choices' parameter? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Intermediate |
| 5 | How do you accept a variable number of arguments for a single flag, like a list of filenames? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Intermediate |
| 6 | How do you implement boolean flags using action='store_true' and action='store_false'? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Intermediate |
| 7 | How do you provide a short and a long form for the same flag, like -v and --verbose? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Intermediate |
| 8 | How do you implement subcommands (like 'git commit' or 'git push') using argparse's add_subparsers()? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 9 | How do you group related arguments visually in the generated --help output using argument groups? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 10 | How do you implement mutually exclusive arguments, where the user must choose EXACTLY ONE of a set of flags? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 11 | How do you write a custom 'type=' validation function for argparse that raises a properly-formatted error for invalid input? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 12 | How would you build a CLI tool where some arguments can also be set via environment variables, falling back to a default if neither is provided? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 13 | How do you customize argparse's automatically-generated usage and help text formatting, like preserving specific line breaks in the description? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 14 | How would you write integration tests for an argparse-based CLI tool using pytest, verifying both successful parsing and expected error behavior? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 15 | How do you build a plugin-style CLI where subcommands are dynamically discovered and registered from separate modules, rather than hardcoded? Python › Command-Line Interfaces (argparse) | Python | Command-Line Interfaces (argparse) | Advanced |
| 16 | What does the `if __name__ == '__main__':` idiom accomplish, and why is it important for modules? Python › Modules & Packaging | Python | Modules & Packaging | Intermediate |
| 17 | How do entry points in packaging metadata enable a package to register CLI commands or plugins? Python › Modules & Packaging | Python | Modules & Packaging | Advanced |