-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
xl commands use inconsistent option names for similar functionality. Users must remember different flags for each command (e.g., -c means columns in some commands, but column index in others; --by vs -c vs --columns).
Current State (Inconsistent)
| Command | Group By Column | Count Column | Sort Column | Select Column |
|---|---|---|---|---|
xl group |
--by |
N/A | N/A | N/A |
xl count |
N/A | --columns / -c |
--sort |
N/A |
xl unique |
N/A | -c, --columns |
N/A | N/A |
xl sort |
N/A | N/A | --by |
N/A |
xl select |
N/A | N/A | N/A | -c, --columns |
xl stats |
N/A | -c, --columns |
N/A | N/A |
xl filter |
Implicit in condition | N/A | N/A | --columns |
xl head |
N/A | N/A | N/A | N/A |
Examples of Inconsistency
Inconsistency 1: Group-By vs Sort
# Group uses --by
xl group sales.xlsx --by "Category" --aggregate "Sales:sum"
# Sort uses --by (consistent!)
xl sort sales.xlsx --by "Sales_sum" --order desc
# But filter uses implicit column reference
xl filter sales.xlsx "Category == 'A'"Problem: Mix of explicit flags and implicit references
Inconsistency 2: Column Specification
# count uses --columns / -c
xl count sales.xlsx --columns "Category"
# unique uses --columns / -c
xl unique sales.xlsx -c "Category"
# select uses --columns / -c
xl select sales.xlsx -c "Category,Sales"
# stats uses -c
xl stats sales.xlsx -c "Sales"
# But group uses --by (not -c!)
xl group sales.xlsx --by "Category" --aggregate "Sales:sum"Problem: Why does xl group use --by while others use -c or --columns?
Inconsistency 3: Limit Options
# head uses -n
xl head sales.xlsx -n 10
# filter uses --rows / -n
xl filter sales.xlsx "condition" --rows 10
# count lacks -n (see XL-006)
xl count sales.xlsx -c "Category" --sort count -n 10 # Error!
# group lacks --limit
xl group sales.xlsx --by "Category" --aggregate "Sales:sum" --limit 10 # Error!Problem: Inconsistent limiting mechanisms
Inconsistency 4: Short Flags
# -s means sheet
xl head sales.xlsx -s DONNEES -n 10
# -s means select in some CLIs (not xl, but still confusing)
# -c means columns (most of the time)
xl count sales.xlsx -c "Category"
# But --by for group (no -b short flag?)
xl group sales.xlsx --by "Category"Problem: No standardized short flag convention
Impact
User Confusion
Users must check --help for every command to remember the right flags:
# User tries:
xl group data.xlsx -c "Category" # Natural, but fails!
# Must check help:
xl group --help
# Oh, it's --by, not -c
# Later tries:
xl count data.xlsx --by "Category" # Natural extension, but fails!
# Must check help again:
# Oh, it's --columns, not --byLearning Curve
New users cannot transfer knowledge between commands:
# Learned: xl head -n 10
# Tries: xl count -c "X" -n 10
# Fails: -n not supported in count (XL-006)Script Fragility
Scripts break when copying patterns between commands:
# Pattern that works for count:
xl count data.xlsx -c "Category" --sort count
# User tries same pattern for group:
xl group data.xlsx -c "Category" --aggregate "Sales:sum"
# Fails: -c not valid for groupProposed Standards
Option 1: Establish Convention (Preferred)
Define standard flags for common operations:
| Operation | Long Flag | Short Flag | Commands Using It |
|---|---|---|---|
| Column(s) | --column / --columns |
-c |
all (group, count, unique, select, stats, sort) |
| Group By | --by |
-b or -g |
group, count |
| Limit | --limit |
-n |
all output commands |
| Sort | --sort |
-s |
group, count, unique |
| Order | --order |
-o |
sort |
| Sheet | --sheet |
-S (capital) |
all Excel commands |
| Output | --output |
-o |
all commands |
Option 2: Aliases for Backwards Compatibility
Add aliases to existing commands:
# xl group accepts both:
xl group data.xlsx --by "Category"
xl group data.xlsx -c "Category" # New alias
# xl count accepts both:
xl count data.xlsx --columns "Category"
xl count data.xlsx -c "Category"
xl count data.xlsx --by "Category" # New aliasOption 3: Smart Flag Detection
Auto-detect flag intent (may be confusing):
# xl group detects -c is column specification
# Automatically maps to --by behaviorRecommendation: Don't do this - too confusing
Acceptance Criteria
Phase 1: Documentation (Quick Win)
- Document all flags in comparison table
- Add "Common Patterns" section to help
- Show flag equivalents across commands
- Add "Did you mean?" suggestions for common mistakes
Phase 2: Standardization (Medium Effort)
-
-cmeans "column(s)" everywhere -
-nmeans "limit" everywhere -
--bymeans "group by" (or use-b) - Add
-bshort flag for--by - Add
-gshort flag for--by(group)
Phase 3: Backwards Compatibility (Long Term)
- Support both old and new flags
- Emit deprecation warnings for old flags
- Document migration path
- Remove old flags after 2-3 version cycles
Test Cases
# Test 1: -c works for all column specifications
xl group data.xlsx -c "Category" --aggregate "Sales:sum" # New
xl count data.xlsx -c "Category" # Existing
xl unique data.xlsx -c "Category" # Existing
# Expected: All work
# Test 2: -n works for all limits
xl head data.xlsx -n 10 # Existing
xl count data.xlsx -c "Category" -n 10 # New (XL-006)
xl group data.xlsx -c "Category" --aggregate "Sales:sum" -n 10 # New
# Expected: All work
# Test 3: -b works for group-by
xl group data.xlsx -b "Category" --aggregate "Sales:sum" # New short flag
xl count data.xlsx -b "Category" # New alias for --columns
# Expected: Both work
# Test 4: Backwards compatibility
xl group data.xlsx --by "Category" --aggregate "Sales:sum" # Old
xl group data.xlsx -c "Category" --aggregate "Sales:sum" # New
# Expected: Both work, same resultProposed Flag Reference
Standard Column Flags
# Single column
-c COLUMN
--column COLUMN
# Multiple columns
-c COL1,COL2,COL3
--columns COL1,COL2,COL3Used in: group, count, unique, select, stats, sort, filter
Standard Group-By Flags
# Single group
--by COLUMN
-b COLUMN # New short flag
# Multiple groups
--by COL1,COL2,COL3
-b COL1,COL2,COL3 # New short flagUsed in: group, aggregate
Standard Limit Flags
-n ROWS
--limit ROWSUsed in: head, count, group, unique, filter
Standard Sort Flags
--sort [asc|desc]
-s [asc|desc] # New short flag (not to conflict with --sheet)Used in: group, count, unique, sort
Implementation Notes
Deprecation Strategy
Version N+0: Add new flags alongside old flags
xl group data.xlsx --by "Category" # Old
xl group data.xlsx -c "Category" # New
# Both work, no warningVersion N+1: Add deprecation warnings
xl group data.xlsx --by "Category"
# Warning: --by is deprecated, use -c or --column instead
# Will be removed in version N+3Version N+2: Remove old flags
xl group data.xlsx --by "Category"
# Error: Unknown option: --by
# Use -c COLUMN or --column COLUMNShort Flag Conflicts
Issue: -s currently means --sheet
Solution:
- Keep
-sfor--sheet(most common use case) - Use
-S(capital) for--sort - Or use
-sfor--sortand change--sheetto--sh? No, too confusing
Recommendation:
-s=--sheet(keep existing)- No short flag for
--sort(use long form only) - Or use
--sortonly (no short flag needed)
Related Issues
- XL-006: xl count lacks -n (inconsistent limit option)
- XL-003: xl group lacks sort (inconsistent sorting)
- XL-009: Unclear pivot syntax (inconsistent aggregation)
Benefits
- Learnability: Once users learn
-c, it works everywhere - Memorability: Fewer flags to remember
- Transferability: Patterns work across commands
- Reduced Help Lookups: Don't need to check
--helpconstantly - Better UX: Feels like a cohesive toolset
Industry Standards
git
git commit -m "msg" # -c for commit (different meaning)
git checkout -b branch # -b for branchgit has consistent conventions across subcommands
SQL
GROUP BY column
ORDER BY columnSQL uses textual keywords, not flags
pandas
df.groupby('column') # Consistent method names
df.sort_values('column')
df[['col1', 'col2']] # Consistent column selectionpandas is very consistent
Recommendation: Follow pandas' consistency example
Labels
design ux consistency medium-priority documentation standards