Skip to content

Conversation

@delmorallopez
Copy link

Re-implement shell tools you have used (Used Python)

Each directory contains instructions for one shell tool to re-implement.

3 files changed in this PR cat (script-02.py), ls (script-02.py), ws (script-02.py)

@delmorallopez delmorallopez force-pushed the Implement-Shell-Tools-Python branch from 828014f to a93b794 Compare December 1, 2025 11:09
@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 1, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jan 14, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start on these tasks, some things to consider:

Can you think of any problems that might arise from the filenames you have given your scripts?

See also my comment in the files. Mostly these implementations are very good and neat, well done

args = parser.parse_args()

# Only -1 is supported, but it's always required in this assignment
if not args.one_per_line:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required? is there a reason i should not output the files on the same line?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no technical reason to require -1.
The program already outputs one file per line regardless, so enforcing -1 is unnecessary.
I added the check because I thought the assignment required explicitly using -1, but in practice the program should either: treat -1 as the default behaviour, or Ignore it entirely since only one output format is implemented.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you re-read the readme for the ls task, can you see where it is asking for -1 to be implemented? You need to be able to test with it on and off. Right now, every time it runs it prints each file on a new line, so even though you removed the option, how will you test if this option is implemented?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right and I understand now perfectly the exercise.... I did some changes in the code wehere the program:

-1 changes output behaviour
-a includes dotfiles

  • Clean error handling
  • Easy to extend later (-l, multiple paths, etc.)

I have tested:
./ls.py
./ls.py -1
./ls.py -a
./ls.py -1 -a
./ls.py sample-files
./ls.py -1 -a sample-files

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jan 14, 2026
@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jan 16, 2026
@LonMcGregor LonMcGregor removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jan 19, 2026
@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jan 19, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work,this task is complete now

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants