commit 697dba3c7c3a97df0437fe352f25bc2181a2d9d7
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Fri Jan 17 10:58:18 2020 +0100

    Major overhaul of the shell.
    A new configuration option allows to set the shell history length.

diff --git a/core/inc/aos_shell.h b/core/inc/aos_shell.h
index b008b2c..cd2b2e1 100644
--- a/core/inc/aos_shell.h
+++ b/core/inc/aos_shell.h
@@ -50,7 +50,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /**
  * @brief   Shell event flag that is emitted when a command is executed.
  */
-#define AOS_SHELL_EVTFLAG_EXEC                    ((eventflags_t)(1 << 1))
+#define AOS_SHELL_EVTFLAG_EXECUTE                 ((eventflags_t)(1 << 1))
 
 /**
  * @brief   Shell event flag that is emitted when a command execution finished.
@@ -239,30 +239,6 @@ typedef struct aos_shellexecstatus {
 } aos_shellexecstatus_t;
 
 /**
- * @brief   Enumerator to encode shell actions.
- */
-typedef enum aos_shellaction {
-  AOS_SHELL_ACTION_NONE,
-  AOS_SHELL_ACTION_READCHAR,
-  AOS_SHELL_ACTION_AUTOFILL,
-  AOS_SHELL_ACTION_SUGGEST,
-  AOS_SHELL_ACTION_INSERTTOGGLE,
-  AOS_SHELL_ACTION_DELETEFORWARD,
-  AOS_SHELL_ACTION_DELETEBACKWARD,
-  AOS_SHELL_ACTION_RECALLLAST,
-  AOS_SHELL_ACTION_CLEAR,
-  AOS_SHELL_ACTION_CURSOR2START,
-  AOS_SHELL_ACTION_CURSOR2END,
-  AOS_SHELL_ACTION_CURSORLEFT,
-  AOS_SHELL_ACTION_CURSORRIGHT,
-  AOS_SHELL_ACTION_CURSORWORDLEFT,
-  AOS_SHELL_ACTION_CURSORWORDRIGHT,
-  AOS_SHELL_ACTION_EXECUTE,
-  AOS_SHELL_ACTION_ESCSTART,
-  AOS_SHELL_ACTION_PRINTUNKNOWNSEQUENCE,
-} aos_shellaction_t;
-
-/**
  * @brief   Shell structure.
  */
 typedef struct aos_shell {
@@ -277,19 +253,9 @@ typedef struct aos_shell {
   event_source_t eventSource;
 
   /**
-   * @brief   Struct for OS related events
+   * @brief   Listener for OS related events.
    */
-  struct {
-    /**
-     * @brief   Pointer to the OS' event source.
-     */
-    event_source_t* eventSource;
-
-    /**
-     * @brief   Listener for OS related events.
-     */
-    event_listener_t eventListener;
-  } os;
+  event_listener_t osEventListener;
 
   /**
      * @brief   Pointer to the first I/O channel.
@@ -318,51 +284,29 @@ typedef struct aos_shell {
   struct {
     /**
      * @brief   Input buffer.
+     * @details This buffer is interpreted as two dimensional array.
+     *          It contains @p nentries elements of @p linewidth size each.
      */
-    char* line;
-
-    /**
-     * @brief   Size of the input buffer.
-     */
-    size_t length;
-
-    /**
-     * @brief   Size of the argument buffer.
-     */
-    size_t nargs;
-  } input;
-
-  /**
-   * @brief   Structure containing data for internal input parsing.
-   */
-  struct {
-    /**
-     * @brief   The last action executed by the shell.
-     */
-    aos_shellaction_t lastaction;
+    char* buffer;
 
     /**
-     * @brief   Buffer to store an escape sequence.
+     * @brief   Number of entries in the buffer.
+     * @note    Must be >0.
      */
-    char escseq[AOS_SHELL_ESCSEQUENCE_LENGTH];
+    size_t nentries;
 
     /**
-     * @brief   Current curso position.
+     * @brief   Width of each input line.
+     * @brief   Must be >0.
      */
-    size_t cursorpos;
+    size_t linewidth;
 
     /**
-     * @brief   Current line width.
-     */
-    size_t lineend;
-
-    /**
-     * @brief   Flag whether there was input since the prompt was printed the last time.
+     * @brief   Size of the argument buffer.
+     * @note    Must be >0.
      */
-    bool noinput;
-  } inputdata;
-
-
+    size_t nargs;
+  } input;
 
   /**
    * @brief   Configuration flags.
@@ -394,7 +338,7 @@ typedef struct aos_shell {
 #if defined(__cplusplus)
 extern "C" {
 #endif /* defined(__cplusplus) */
-  void aosShellInit(aos_shell_t* shell, event_source_t* oseventsource, const char* prompt, char* line, size_t linesize, size_t numargs);
+  void aosShellInit(aos_shell_t* shell, const char* prompt, char inbuf[], size_t entries, size_t linewidth, size_t numargs);
   void aosShellStreamInit(AosShellStream* stream);
   void aosShellChannelInit(AosShellChannel* channel, BaseAsynchronousChannel* asyncchannel);
   aos_status_t aosShellAddCommand(aos_shell_t* shell, aos_shellcommand_t* cmd);
