16 lines
385 B
Python
16 lines
385 B
Python
"""CLI utility functions."""
|
|
|
|
|
|
def parse_commands_from_file(path: str) -> list[str]:
|
|
"""Parse commands from a file, one per line."""
|
|
with open(path, 'r') as f:
|
|
lines = f.readlines()
|
|
|
|
commands = []
|
|
for line in lines:
|
|
stripped = line.strip()
|
|
if stripped and not stripped.startswith('#'):
|
|
commands.append(stripped)
|
|
|
|
return commands
|