Fossil

Check-in [6327b026]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use linenoise for fossil shell. Do not bother with persistent history.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6327b026a866ace35f3f529b5e8f354c17c3f6db
User & Date: andygoth 2016-11-04 23:57:42
Context
2016-11-05
02:29
Implement style_submenu_checkbox(). Change "unhide" to a checkbox so it can be cancelled without editing the URL by hand. Update skins to support use of <label> tag. Remove redundant "if" check in style.c. Checkbox styling can certainly be improved, but this is a start. check-in: 8d880f0b user: andygoth tags: trunk
2016-11-04
23:57
Use linenoise for fossil shell. Do not bother with persistent history. check-in: 6327b026 user: andygoth tags: trunk
23:18
Cherrypick [9b960af129], was supposed to have been checked into trunk in the first place check-in: bbafc013 user: andygoth tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/fshell.c.

23
24
25
26
27
28
29

30
31
32
33
34
35
36
..
53
54
55
56
57
58
59
60
61
62
63
64
65



66
67
68
69
70
71
72
**
** The "fossil shell" command is intended for use with SEE-enabled fossil.
** It allows multiple commands to be issued without having to reenter the
** crypto phasephrase for each command.
*/
#include "config.h"
#include "fshell.h"

#include <ctype.h>

#ifndef _WIN32
#include <sys/types.h>
#include <sys/wait.h>
#endif

................................................................................
#else
  int nArg;
  int mxArg = 0;
  int n, i;
  char **azArg = 0;
  int fDebug;
  pid_t childPid;
  char zLine[10000];
  fDebug = find_option("debug", 0, 0)!=0;
  db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0);
  db_close(0);
  sqlite3_shutdown();
  while( printf("fossil> "),fflush(stdout),fgets(zLine, sizeof(zLine), stdin) ){



    /* Parse the line of input */
    n = (int)strlen(zLine);
    for(i=0, nArg=1; i<n; i++){
      while( fossil_isspace(zLine[i]) ){ i++; }
      if( i>=n ) break;
      if( nArg>=mxArg ){
        mxArg = nArg+10;







>







 







|




|
>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
..
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
**
** The "fossil shell" command is intended for use with SEE-enabled fossil.
** It allows multiple commands to be issued without having to reenter the
** crypto phasephrase for each command.
*/
#include "config.h"
#include "fshell.h"
#include "linenoise.h"
#include <ctype.h>

#ifndef _WIN32
#include <sys/types.h>
#include <sys/wait.h>
#endif

................................................................................
#else
  int nArg;
  int mxArg = 0;
  int n, i;
  char **azArg = 0;
  int fDebug;
  pid_t childPid;
  char *zLine = 0;
  fDebug = find_option("debug", 0, 0)!=0;
  db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0);
  db_close(0);
  sqlite3_shutdown();
  while( (free(zLine), zLine = linenoise("fossil> ")) ){
    /* Remember shell history within the current session */
    linenoiseHistoryAdd(zLine);

    /* Parse the line of input */
    n = (int)strlen(zLine);
    for(i=0, nArg=1; i<n; i++){
      while( fossil_isspace(zLine[i]) ){ i++; }
      if( i>=n ) break;
      if( nArg>=mxArg ){
        mxArg = nArg+10;