-
Notifications
You must be signed in to change notification settings - Fork 25
Project01 - less/more and echo #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Verification Testing I did find one bug when testing the 'more' command. I noticed when entered an invalid key when inside the more process it clearly states my input is invalid and displays a list of available commands. However, if I enter " someinvalidinput" the program does display both the next page and error since it detected the space at the start of the input Unknown command. Available commands: more - Displays the contents of a file one screen at a time + <Return/Enter> - Display next page of file Line 51: Welcome to page 3! Unknown command. Available commands: more - Displays the contents of a file one screen at a time + <Return/Enter> - Display next page of file Unknown command. Available commands: more - Displays the contents of a file one screen at a time + <Return/Enter> - Display next page of file Code Walkthrough Suggestion to fix switch case in more.c. If the program detects an invalid key it will go to default and display error but if it keeps detecting invalid keys it will keep displaying errors. We could change this to read the entire line at once to see if we have a valid input: Formatting High Level Checks:
Code Checks:
|
CODE REVIEW #2Checking to make sure the functionality delivered matches the original goals? Correcting any minor formatting or documentation issues Proposing ways to refactor the code to improve readability, efficiency, or correctness More.c Replace Recursion with Loop in more.c - Line 95. void User_command(void) { } issue: Each invalid command adds a new stack frame. A malicious or confused user could crash the program You should also verify each item in the following checklist: High Level Checks:
Code Checks:
|
|
This looks great, although I think the interactive claims are a bit misleading in This makes sense because there is no way to read raw input from the terminal, but I think it would've been better to be up front about it and redesign the interface in such a way that a user of the normal more/less on a unix machine won't be confused. Perhaps come up with a set of single-character commands that the user can enter, e.g., n + enter goes to the next line, p + enter goes up one, etc. so everything is consistent. Cool project and nice job implementing it. Getting this to work perfectly is not so easy. 4.5/5 +0.5 -> fix keybindings and make consistent across more / less |
Description
This PR adds and documents user-space utilities echo, less, and more for FogOS/xv6.
echo
New features
Testing
Commands verified inside QEMU:
more
Navigation keys
Testing
Commands verified inside QEMU:
less
Navigation keys
Testing
Commands verified inside QEMU:
Build and run
Documents
docs/readmemore.md
docs/readmeLess.md
docs/readmeEcho.md
Test
moreLessTest1.txt
moreLessTest2.txt moreLessEmptyTest.txt
user/echo-testing.txt
Checklist