Skip to content

Implement the comment handling feature #18

@nanafox

Description

@nanafox

The comments feature of the shell is similar to what you already know about comments in programming.
They are a way of giving hints to the user and ourselves and are not necessarily processed by the computer as a special case.

Your task is to get rid of all possible comments in user input at the prompt. This will be done at the initial stages of parsing the user's input. Your function will

  1. take the user's input
  2. parser it while looking for comments (starts with the # sign)
  3. once it finds one, it gets rid of everything after that
  4. finally, it returns the updated string for further processing or parsing

Note: if you don't find any # in the input string, return the original string as is. Also, as an edge case, check these out

ls #/tmp

ls#/tmp

What was the output when executed on sh?
Do you understand why?

Metadata

Metadata

Labels

featureimplemented a featuretasknew task accomplised

Type

No type

Projects

Status

📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions