Crate clap_sort

Crate clap_sort 

Source
Expand description

§clap-sort

A library to validate that clap subcommands and arguments are sorted.

This crate provides functionality to validate that:

  • Subcommands are sorted alphabetically
  • Arguments are grouped and sorted by type:
    1. Positional arguments (order not enforced - parsing order matters)
    2. Flags with short options (alphabetically by short option)
    3. Long-only flags (alphabetically)

Functions§

assert_sorted
Validates that subcommands and arguments are sorted correctly.
is_sorted
Checks if subcommands and arguments are sorted, returning a Result instead of panicking.