From ccb2799841961866785512b59658afd796b9b891 Mon Sep 17 00:00:00 2001 From: Udeshya Dhungana <075bct095.udeshya@pcampus.edu.np> Date: Fri, 20 Feb 2026 11:31:09 +0545 Subject: [PATCH 1/3] Update stage difficulty and command completion extension name --- course-definition.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/course-definition.yml b/course-definition.yml index 377f899..b09c566 100644 --- a/course-definition.yml +++ b/course-definition.yml @@ -129,11 +129,11 @@ extensions: Redirection allows you to redirect the output of a command to a file or another command. - slug: "completions" - name: "Autocompletion" + name: "Command Completion" description_markdown: | - In this challenge extension, you'll add programmable completion support to your shell. + In this challenge extension, you'll add command completion support to your shell. - Programmable completion allows you to autocomplete commands and executable files. + Command completion allows you to autocomplete commands and executable files. - slug: "filename-completion" name: "Filename Completion" @@ -382,7 +382,7 @@ stages: - slug: "lc6" primary_extension_slug: "filename-completion" name: "Directory completion" - difficulty: medium + difficulty: easy marketing_md: |- In this stage, you'll add support for completing directory names. @@ -396,7 +396,7 @@ stages: - slug: "no5" primary_extension_slug: "filename-completion" name: "Multiple matches" - difficulty: medium + difficulty: hard marketing_md: |- In this stage, you'll add support for handling filename completion in case of multiple matches. From 784f882fca29925a79429fceabe2d2837e84b49f Mon Sep 17 00:00:00 2001 From: Udeshya Dhungana <075bct095.udeshya@pcampus.edu.np> Date: Fri, 20 Feb 2026 15:21:50 +0545 Subject: [PATCH 2/3] Add readline library info in the Notes section --- .../filename-completion-01-zv2.md | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/stage_descriptions/filename-completion-01-zv2.md b/stage_descriptions/filename-completion-01-zv2.md index e22fec6..960cec0 100644 --- a/stage_descriptions/filename-completion-01-zv2.md +++ b/stage_descriptions/filename-completion-01-zv2.md @@ -8,6 +8,8 @@ When the user presses `` while typing an argument: 2. Find files whose names start with the typed prefix. 3. Complete the filename and add a trailing space. +The argument completion does not depend on the command. + For example, ```bash @@ -48,4 +50,30 @@ The tester will verify that: - In this stage, you'll only need to handle cases of single matching filename, we'll get to implementing completion in cases of directories, and multiple completions in the later stages. -- The argument completion does not depend on the command. \ No newline at end of file +{{#lang_is_rust}} +- We recommend using a library like [rustyline](https://crates.io/crates/rustyline/) for your implementation. Most modern shells and REPLs (like the Python REPL) use [GNU readline](https://www.wikiwand.com/en/articles/GNU_Readline) under the hood. While you may need to override some of its default behaviors, it's typically less work than starting from scratch. +{{/lang_is_rust}} + +{{#lang_is_python}} +- We recommend using the module [readline](https://docs.python.org/3/library/readline.html) for your implementation. Most modern shells and REPLs (like the Python REPL) use [GNU readline](https://www.wikiwand.com/en/articles/GNU_Readline) under the hood. While you may need to override some of its default behaviors, it's typically less work than starting from scratch. +{{/lang_is_python}} + +{{#lang_is_go}} +- We recommend using a library like [readline](https://pkg.go.dev/github.com/chzyer/readline) for your implementation. Most modern shells and REPLs (like the Python REPL) use [GNU readline](https://www.wikiwand.com/en/articles/GNU_Readline) under the hood. While you may need to override some of its default behaviors, it's typically less work than starting from scratch. +{{/lang_is_go}} + +{{#lang_is_java}} +- We recommend using a library like [JLine](https://github.com/jline/jline3) for your implementation. Most modern shells and REPLs (like the Python REPL) use [GNU readline](https://www.wikiwand.com/en/articles/GNU_Readline) under the hood. While you may need to override some of its default behaviors, it's typically less work than starting from scratch. +{{/lang_is_java}} + +{{^lang_is_rust}} +{{^lang_is_python}} +{{^lang_is_go}} +{{^lang_is_java}} +- We recommend using a library like [readline](https://en.wikipedia.org/wiki/GNU_Readline) for your implementation. Most modern shells and REPLs (like the Python REPL) use readline under the hood. While you may need to override some of its default behaviors, it's typically less work than starting from scratch. +{{/lang_is_java}} +{{/lang_is_go}} +{{/lang_is_python}} +{{/lang_is_rust}} + +- Different shells handle autocompletion differently. For consistency, we recommend using [Bash](https://www.gnu.org/software/bash/) for development and testing. \ No newline at end of file From 1a003f6d8c14169b757dd23b4c42b874768f81c2 Mon Sep 17 00:00:00 2001 From: Udeshya Dhungana <075bct095.udeshya@pcampus.edu.np> Date: Fri, 20 Feb 2026 15:24:32 +0545 Subject: [PATCH 3/3] Merge Notes 1 and 2: Apply LLM suggestion --- stage_descriptions/filename-completion-01-zv2.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stage_descriptions/filename-completion-01-zv2.md b/stage_descriptions/filename-completion-01-zv2.md index 960cec0..f894f09 100644 --- a/stage_descriptions/filename-completion-01-zv2.md +++ b/stage_descriptions/filename-completion-01-zv2.md @@ -46,9 +46,7 @@ The tester will verify that: ### Notes -- In this stage, you'll only need to match the prefix against the entry in the current working directory. We'll get to implementing completion in case of nested directories in the later stages. - -- In this stage, you'll only need to handle cases of single matching filename, we'll get to implementing completion in cases of directories, and multiple completions in the later stages. +- In this stage, you may only match the prefix against entries in the current working directory and handle only a single matching filename. We'll get to supporting nested directories and multiple matches in the later stages. {{#lang_is_rust}} - We recommend using a library like [rustyline](https://crates.io/crates/rustyline/) for your implementation. Most modern shells and REPLs (like the Python REPL) use [GNU readline](https://www.wikiwand.com/en/articles/GNU_Readline) under the hood. While you may need to override some of its default behaviors, it's typically less work than starting from scratch.