mikeizbicki / ucr-cs100

open source software construction course
Other
485 stars 407 forks source link

Hw#1 Clarification #323

Closed jesuscreyes closed 9 years ago

jesuscreyes commented 9 years ago

It says that we're adding the code of this assignment to our rshell project on github.

I just want to clarify, does that mean that we're implementing our code for this new assignment to our code for hw#0?

By that, I mean, we'll be running the same program as Hw#0 for this assignment, except when we enter an ls command, we now use our own implementation?

Or, are we creating a totally separate piece of code that is independent from our code from hw#0?

Thanks!

2c2c commented 9 years ago

separate file ls.cpp in the same project

the idea is that any implementation of ls should be blind as to whom is executing it. meaning after calling make your project you should have a /bin/ls in your rshell folder that can be ran from your standard shell or rshell.

hgarc014 commented 9 years ago

320 #315

lt is a different executable from rshell. By adding code to your rshell project it means you should still be adding all the files, etc. to your "rshell project" on github, but not your rshell terminal.

tkimva commented 9 years ago

@hgarc014 is right. This homework 1 is to implement ls.cpp in your current rshell repository. New code is totally independent from rshell code. However, you need to use same repository.

You will add ls.cpp code to your rshell repository on github. Create a branch called ls and implement all of your code under this ls branch. When finished, merge with the master branch and create a tag called hw1.

So, for instance, once you finish your homework, then your src directory has ls.cpp and your hw0 code like rshell.cpp or exec.cpp

You will have to modify the Makefile to include a target called ls which builds your ls program. The all target should build both rshell and ls. Both binaries should be placed in the bin folder.

jesuscreyes commented 9 years ago

I think I got it. Thanks for your responses!

//Updated

Actually, I have another question. So for this program, are we supposed to handle input and exiting the program similar to hw0? By that I mean, we're constantly asking for input from the user, and to exit the program, the user inputs exit?

ChemicalWonders commented 9 years ago

I don't think you need to constantly ask for input from the user. If you take a look at ls, you're taking ls, and you're putting the commands in. You're not stuck in an infinite loop when you call it, you call it once, and you call it every time you need to run the command.

I think as long as your ls works, you should be okay.