Move CLI defaults to cli.py and refactor ls.py parameter handling
- Dominant language
- Python
- Stars
- 12
- Forks
- 6
- Avg merge
- 11d 11h
- Merged PRs (30d)
- 1
Description
## Context
Follow-up to #372 (duct_main.py breakup). Two constants remain in `duct_main.py` that are really CLI defaults:
- `DUCT_OUTPUT_PREFIX` - default for `--output-prefix`
- `EXECUTION_SUMMARY_FORMAT` - default for `--summary-format`
These should live in `cli.py` with the argument definitions, not in a separate module.
## Proposed Changes
1. **Rename constants** to clarify they're defaults:
- `DUCT_OUTPUT_PREFIX` → `DEFAULT_OUTPUT_PREFIX`
- `EXECUTION_SUMMARY_FORMAT` → `DEFAULT_SUMMARY_FORMAT`
2. **Move to `cli.py`** - CLI defaults belong with CLI code
3. **Refactor `ls.py`** - Currently imports `DUCT_OUTPUT_PREFIX` to construct a glob pattern when no paths are given:
```python
pattern = f"{DUCT_OUTPUT_PREFIX[:DUCT_OUTPUT_PREFIX.index('{')]}*"
```
This creates a circular import if the constant moves to `cli.py` (cli imports ls).
Solution: Add a `--search-prefix` (or similar) CLI argument to `con-duct ls` and pass it as a parameter to the `ls()` function.
4. **Update tests** to import from the new location
## Blocked By
- #385 should merge first
Contributor guide
Assessment
This issue has not been assessed yet.