OwnUniq

Phase 1 - Basic argument handling and line grouping

Implement a Python script that reads command-line arguments and groups consecutive identical strings, mimicking minimal uniq behavior.

  • Read inputs exclusively from sys.argv[1:]
  • Group consecutive duplicate arguments
  • Print one representative per group

Functional result: Script outputs collapsed consecutive duplicates exactly in the order received.

Phase 2 - Extended uniq-style options

Add simple flags to control output formatting and filtering, similar to common uniq options.

  • Add -c to show counts before each grouped line
  • Add -d to print only duplicated groups
  • Ensure flags can be combined

Functional result: Script correctly applies flags and prints filtered or counted groups based on selected options.