Skip to content

[Good First Issue] Add Undo Functionality #4

@SthembisoMfusi

Description

@SthembisoMfusi

🎯 Issue Description

Sometimes users want to undo the organization. Let's add an undo feature that can restore files to their original locations!

🚀 What You'll Learn

  • File system operations
  • Data persistence (logging moves)
  • Command-line argument parsing

📋 Tasks

  • Create a log file to track file moves
  • Add --undo command line option
  • Implement undo logic to restore files
  • Add safety checks (don't overwrite existing files)
  • Update help text and documentation

🛠️ Files to Modify

  • py_sort.py
  • README.md

💡 Hints

  • Log moves to a JSON file with timestamp
  • Store original path and new path for each move
  • Add confirmation prompt for undo operation

🧪 Testing

python py_sort.py ~/Downloads
python py_sort.py ~/Downloads --undo

❓ Questions?

Feel free to ask questions in the comments or start a discussion!

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions