Skip to content

London | 26-SDC-July| Mariia Serhiienko | Sprint 3 | Implement shell tools - #659

Open
Konvaly wants to merge 3 commits into
CodeYourFuture:mainfrom
Konvaly:implement-shell-tools-2
Open

London | 26-SDC-July| Mariia Serhiienko | Sprint 3 | Implement shell tools#659
Konvaly wants to merge 3 commits into
CodeYourFuture:mainfrom
Konvaly:implement-shell-tools-2

Conversation

@Konvaly

@Konvaly Konvaly commented Aug 10, 2026

Copy link
Copy Markdown

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

Implemented my own cat, ls and wc in JavaScript.
No dependencies; I used the built-in 'node:util' parseArgs for the flags instead of commander, since nothing here needs '--help'.
Task ID: CYF-1150

@Konvaly Konvaly added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 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, I have a few comments for some files

const numberNonBlank = values["number-nonblank"];

if (positionals.length === 0) {
console.error("Usage: node cat.js [-n] [-b] <path>...");

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 you could use to manage argument parsing, that would do all this for you?


const { values, positionals } = parseArgs({
options: {
one: { type: "boolean", short: "1", default: false },

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.

Where do you use the "one" argument?

const paths = positionals.length > 0 ? positionals : ["."];

function stripPunctuation(name) {
return name.replace(/[^\p{L}\p{N}]/gu, "");

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.

This looks quite complex. What does this regexp do, and why are you using it?

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants