From c22c3949c2bdccf510d482247262520c5c77e7ca Mon Sep 17 00:00:00 2001 From: Aethor Date: Wed, 7 Jun 2017 18:56:22 +0200 Subject: [PATCH 1/2] "cd" now works without arguments, added README --- fish_shell/fish_commands.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fish_shell/fish_commands.c b/fish_shell/fish_commands.c index 1249b8f..99a7c1a 100644 --- a/fish_shell/fish_commands.c +++ b/fish_shell/fish_commands.c @@ -6,6 +6,7 @@ #include #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"); From 10234a6b72e86bbbaf277580d4cbcf5f486418c2 Mon Sep 17 00:00:00 2001 From: Aethor Date: Wed, 7 Jun 2017 19:00:35 +0200 Subject: [PATCH 2/2] hu, sry, forgot ;-; --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..45a0cef --- /dev/null +++ b/README.md @@ -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.