Merge branch 'bro' into 'master'

cd without arguments + README

See merge request !14
This commit is contained in:
Antoine Bartuccio 2017-06-08 00:16:51 +00:00
commit 8861c65ca6
2 changed files with 49 additions and 2 deletions

38
README.md Normal file
View File

@ -0,0 +1,38 @@
# fish : Fabulously Irrespectuous SHell
fish is a student project, aiming to be a basic interactive shell for linux.
## Warnings
fish is really an IRRESPECTUOUS shell. Now that you're warned...
## Features
fish reads from standard input and send you the result of every command on standard output ( unless you redirect I/O ). Aside of that, fish also implements various features :
* **Internal commands** : change of directory, exiting, help.
* **External commands** : fish will execute any command you ask, provided he can find those in his PATH variable.
* **Insults** : fish will yell at you whenever you make a mistake to make sure you never fail again.
* **Configuration file** : .fishrc file for easy configuration ( path, prompt.. ).
* **Globbing** : fish implements a globbing feature, handling characters such as \*, ? and ( soon ) ~.
* **Operators** : fish comes with some operators support : **&&** and **||**.
* **I/O redirections** : coming soon ( TM )
everything without a single memory leak ! ( if you find one tell us )
## License
fish is licensed under the GPLv3 license.
## About us
We're 3 students in CS, and this was one of our project.
* Klmp200/Sli : Works for google in another dimension.
* Aethor/Bro : Not even a saint in the church of Emacs.
* Ame : The silent game master.

View File

@ -6,6 +6,7 @@
#include <stdlib.h>
#include "fish_core.h"
#include "fish_types.h"
#include "fish_settings.h"
/* Necessary global variables */
char * builtinCommandsStr[] = {
@ -32,8 +33,16 @@ builtinCommand **getBuiltinCommands(){
int fishCd(WordArray *args) {
if (args->size < 2){
fprintf(stderr, "fish: Où sont les arguments de ta commande \"cd\" connard ?!\n");
return EXIT_FAILURE;
//fprintf(stderr, "fish: Où sont les arguments de ta commande \"cd\" connard ?!\n");
Settings* settings = getSettings();
if(chdir(settings->passwd->pw_dir) != 0){
perror("fish");
return EXIT_FAILURE;
}
freeSettings(settings);
//return EXIT_SUCCESS;
} else {
if (chdir(args->words[1]) != 0){
perror("fish");