Skip to content

NW|26-JUI-SDC|Ahmad Hmedan|Sprint 3 |Implement-shell-tools-JS - #599

Open
AhmadHmedann wants to merge 8 commits into
CodeYourFuture:mainfrom
AhmadHmedann:Implement-shell-tools
Open

NW|26-JUI-SDC|Ahmad Hmedan|Sprint 3 |Implement-shell-tools-JS #599
AhmadHmedann wants to merge 8 commits into
CodeYourFuture:mainfrom
AhmadHmedann:Implement-shell-tools

Conversation

@AhmadHmedann

@AhmadHmedann AhmadHmedann commented Jul 23, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Implement cat, ls, and wc CLI

Task ID: CYF-1150

@AhmadHmedann AhmadHmedann added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 23, 2026
Continue processing remaining files after an error.
Set the process exit code to 1 if any file fails.
Count zero words for empty files.
@AhmadHmedann AhmadHmedann added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 26, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Aug 4, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good start but there is quite a bit of work still to do.

.name("ls ")
.description("ls implementation")
.argument("[path]", "The path to process") //zero or one path
.option("-1, --one-per-line", "one file per line")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does the -1 option do?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the feedback. If the user adds the -1 flag, it doesn't throw an error, but in my code it doesn't have any effect.

hadError = true;
}
}
if (paths.length > 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When you have multiple files, is the output well formatted?

try {
const content = await fs.readFile(path, "utf-8");
if (options.b) {
const lines = content.split("\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any repetition here that can be reduced?

@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 Aug 4, 2026
@AhmadHmedann AhmadHmedann added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants