Skip to main content

One post tagged with "validators"

Input validation and reliable command-line boundaries.

View All Tags

Getting Started with quiCkLI: Reading Files and Validating Input

· 4 min read
Sven Patrick Meier
Creator and maintainer of quiCkLI, an educational Python CLI framework

In Part 1 you built a greeting tool with a single argument and a flag. In this article you will add two new ideas: validators that reject invalid input before your handler runs, and global options that apply to every command in an application.

The example is quickcat, a minimal file viewer modeled after the Unix cat command.

note

Application.run() reads sys.argv[1:] by default. Pass an explicit list to override, or set auto_sys_argv=False to disable automatic reading.