Skip to content

London | 6-SDC-Aug | Boshra Mahmoudi | Sprint 3 | Implement shell tools - #652

Open
BoshraM wants to merge 19 commits into
CodeYourFuture:mainfrom
BoshraM:9-implement-shell-tools-cat-ls-wc-in-javascript-with-nodejs
Open

London | 6-SDC-Aug | Boshra Mahmoudi | Sprint 3 | Implement shell tools#652
BoshraM wants to merge 19 commits into
CodeYourFuture:mainfrom
BoshraM:9-implement-shell-tools-cat-ls-wc-in-javascript-with-nodejs

Conversation

@BoshraM

@BoshraM BoshraM commented Aug 7, 2026

Copy link
Copy Markdown
  • 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

This pull request is related to the Shell pipelines exercise task in the CYF Circulum sprint2.

Task ID: CYF-1150

@BoshraM BoshraM added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. labels Aug 7, 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 I think there are some changes that could be made

Comment thread implement-shell-tools/cat/cat.js Outdated
import { readFile } from "node:fs/promises";
import process from "node:process";

const argv = process.argv.slice(2);

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 a library or API you could use to handle arguments for you?

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.

Hi @LonMcGregor , thanks for raising this. I’ve updated the code to use import { parseArgs } from "node:util";.

Comment thread implement-shell-tools/wc/wc.js Outdated
}

if (files.length > 1 ) {
if (countLines && countWords) {

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.

There's some repeated patterns of code here, can you find a way to reduce it?

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.

@LonMcGregor , I’ve created a function that can be reused in the main logic, so I don’t need to repeat the same code.

@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. labels Aug 12, 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 work. Using a library for argument handling is a good idea as it can be fiddly and difficult to maintain otherwise. Good work refactoring the repeated print pattern

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 9, 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. Module-Tools The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants