]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Take CLI's wordwrap from trunk
authorlarrybr <larrybr@noemail.net>
Tue, 1 Feb 2022 15:08:10 +0000 (15:08 +0000)
committerlarrybr <larrybr@noemail.net>
Tue, 1 Feb 2022 15:08:10 +0000 (15:08 +0000)
FossilOrigin-Name: 768c70a926bd3d5338c4d7c07689e61f03973b4bc7d9d2c62c6f83a6c2b85829

1  2 
manifest
manifest.uuid
src/shell.c.in

diff --cc manifest
index 7988d191d1c8cb24758a85f0612d77289596f72d,1b9116fe1a5fff230dcf0b4b21555cbb525accd3..0f7e2c9f825299d0ed4e1e7b7b791c49a63185ec
+++ b/manifest
@@@ -1,5 -1,5 +1,5 @@@
- C Sync\sto\strunk
- D 2022-01-31T19:52:30.524
 -C CLI:\sTake\sextra\scare\sto\snot\ssplit\sa\smulti-byte\sunicode\scharacter\swhen\sdoing\nwordwrap.
 -D 2022-02-01T13:17:11.049
++C Take\sCLI's\swordwrap\sfrom\strunk
++D 2022-02-01T15:08:10.395
  F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
  F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
  F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@@ -553,7 -553,7 +553,7 @@@ F src/random.c 097dc8b31b8fba5a9aca1697
  F src/resolve.c 24032ae57aec10df2f3fa2e20be0aae7d256bc704124b76c52d763440c7c0fe9
  F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
  F src/select.c a6d2d4bed279d7fe4fcedaf297eaf6441e8e17c6e3947a32d24d23be52ac02f2
- F src/shell.c.in 55d2161e0da793ad38c84e391f6aebf81e687ab3e8389d9c51dd05e3ebef0c45
 -F src/shell.c.in 2f58e6aa6b3d2012db32f1c5fa4591e9d12fd582904632b4fc8f57a382b98fd3
++F src/shell.c.in 285e00069c9c1d0c55d70489cb13e7a75c08d44761e1015f7839f945a6a81cbd
  F src/sqlite.h.in eaade58049152dac850d57415bcced885ca27ae9582f8aea2cfb7f1db78a521b
  F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
  F src/sqlite3ext.h 5d54cf13d3406d8eb65d921a0d3c349de6126b732e695e79ecd4830ce86b4f8a
@@@ -1942,8 -1942,8 +1942,8 @@@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a9
  F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
  F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
  F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
- P 5cf66e89071b619d116a4707b6ff1cd7917edffe5ab504514f37da433a77b61d 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a
- R 8a6470510b0d975aef4cae0efde55caf
 -P 1b528e31f8c62797e0814568b520c0680ff23a2ee877ca6aa70a167d40ebdf80
 -R fe91994efd36a88115500529351b7e2e
 -U drh
 -Z 4d3a3178c78a3baab7f87b0b2d56c876
++P f51a17b6271a8dd7c48725e4ec2df1fde0460866c81c7225dc27216ab389591e 00b1b7020a564976da3237532434e47ccf17eb5d620e6ac45f3e70b5d5739200
++R de0a9f4bae0a768836bea9c7e678066d
 +U larrybr
- Z adeafb366e133cc01524fb4c6c546d1f
++Z 216ac63c3bf7c9a422cebb513acf55e0
  # Remove this line to create a well-formed Fossil manifest.
diff --cc manifest.uuid
index 815cba63882106e825897d59fd91458b9348766d,0347e193b46118502219acf81f2fbba293a6d40b..741bc1c157e142c2b9705b088d9706e7b1f38b57
@@@ -1,1 -1,1 +1,1 @@@
- f51a17b6271a8dd7c48725e4ec2df1fde0460866c81c7225dc27216ab389591e
 -00b1b7020a564976da3237532434e47ccf17eb5d620e6ac45f3e70b5d5739200
++768c70a926bd3d5338c4d7c07689e61f03973b4bc7d9d2c62c6f83a6c2b85829
diff --cc src/shell.c.in
index 42149f77868fd26d74f369fa407295c266bc6755,ef8afe026d37c60ccea637e1a1a725368f363f34..0e403b433ab01fb28d98156e219eb5897c917224
@@@ -1158,49 -1066,15 +1158,58 @@@ struct EQPGraph 
    char zPrefix[100];    /* Graph prefix */
  };
  
 +/* Input source switching is done through one of these (defined below) */
 +typedef struct InSource InSource;
 +
 +/* Selectively omit features with one PP variable. Value is true iff
 +** either x is not defined or defined with 0 in bitnum bit position.
 +*/
 +#define NOT_IFDEF_BIT(x,bitnum) (x? (!(x & (1<<bitnum))) : !(x+0))
 +
 +/* Whether build will include extended input parsing option */
 +#define SHEXT_PARSING_BIT 0
 +#define SHELL_EXTENDED_PARSING \
 +  NOT_IFDEF_BIT(SHELL_OMIT_EXTENSIONS, SHEXT_PARSING_BIT)
 +/* Whether build will include dynamic dot-command extension */
 +#define SHEXT_DYNCMDS_BIT 1
 +#define SHELL_DYNAMIC_COMMANDS \
 +  NOT_IFDEF_BIT(SHELL_OMIT_EXTENSIONS, SHEXT_DYNCMDS_BIT)
 +/* Whether build will include expansion of variables in dot-commands */
 +#define SHEXT_VAREXP_BIT 2
 +#define SHELL_VARIABLE_EXPANSION \
 +  NOT_IFDEF_BIT(SHELL_OMIT_EXTENSIONS, SHEXT_VAREXP_BIT)
 +
 +#define SHELL_ALL_EXTENSIONS \
 +  (1<<SHEXT_PARSING_BIT)+(1<<SHEXT_DYNCMDS_BIT)+(1<<SHEXT_VAREXP_BIT)
 +#if !defined(SHELL_OMIT_EXTENSIONS)
 +# define SHELL_EXTENSIONS SHELL_ALL_EXTENSIONS
 +#else
 +# define SHELL_EXTENSIONS (~SHELL_OMIT_EXTENSIONS) & SHELL_ALL_EXTENSIONS
 +#endif
 +
 +/* Runtime test for shell extended parsing, given ShellState pointer */
 +#if SHELL_EXTENDED_PARSING
 +# define SHEXT_PARSING(pSS) (pSS->bExtendedDotCmds & (1<<SHEXT_PARSING_BIT) !=0)
 +#else
 +# define SHEXT_PARSING(pSS) 0
 +#endif
 +
 +/* Runtime test for shell variable expansion, given ShellState pointer */
 +#if SHELL_EXTENDED_PARSING
 +# define SHEXT_VAREXP(pSS) (pSS->bExtendedDotCmds & (1<<SHEXT_VAREXP_BIT) !=0)
 +#else
 +# define SHEXT_VAREXP(pSS) 0
 +#endif
 +
+ /* Parameters affecting columnar mode result display (defaulting together) */
+ typedef struct ColModeOpts {
+   int iWrap;            /* In columnar modes, wrap lines reaching this limit */
+   u8 bQuote;            /* Quote results for .mode box and table */
+   u8 bWordWrap;         /* In columnar modes, wrap at word boundaries  */
+ } ColModeOpts;
+ #define ColModeOpts_default { 60, 0, 0 }
+ #define ColModeOpts_default_qbox { 60, 1, 0 }
  /*
  ** State information about the database connection is contained in an
  ** instance of the following structure.
@@@ -1219,10 -1093,8 +1228,11 @@@ struct ShellState 
    u8 eTraceType;         /* SHELL_TRACE_* value for type of trace */
    u8 bSafeMode;          /* True to prohibit unsafe operations */
    u8 bSafeModePersist;   /* The long-term value of bSafeMode */
 +  u8 bExtendedDotCmds;   /* Bits set to enable various shell extensions */
+   ColModeOpts cmOpts;    /* Option values affecting columnar mode output */
    unsigned statsOn;      /* True to display memory stats before each finalize */
 +  u8 bQuote;             /* Quote results for .mode box and table */
 +  int iWrap;             /* In columnar modes, wrap lines reaching this limit */
    unsigned mEqpLines;    /* Mask of veritical lines in the EQP output graph */
    int inputNesting;      /* Track nesting level of .read and other redirects */
    int outCount;          /* Revert to stdout when reaching zero */