feat: add simple config for iSearch #17
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#15
add config feature and add 2 simple config for iSearch
will search config file by below order
(a) source file directory
(b)
~/.iSearch/iSearch.txt
(c)
~/.config/iSearch/iSearch.txt
(d) system variable
ISEARCH_CONF
2 config parameters
DEFAULT_SAVE_DB_LEVEL
, same as'请输入,放弃保存0,优先级(1~5)(默认为3),6自定义\n>>> '
, default is 3SKIP_SAVE_DB_CONFIRM_MESSAGE
can ignore above confirm message. default is falseif there is no config file, then will follow default settings
#15
添加了config文件功能, 并添加两个配置项
会遵循以下优先级查询config文件
(a) 源代码目录
(b)
~/.iSearch/iSearch.txt
(c)
~/.config/iSearch/iSearch.txt
(d) 系统环境变量
ISEARCH_CONF
新增配置变量
DEFAULT_SAVE_DB_LEVEL
, 定义右边输入的文字,'请输入,放弃保存0,优先级(1~5)(默认为3),6自定义\n>>> '
, 默认为3SKIP_SAVE_DB_CONFIRM_MESSAGE
可以忽略(不输出)上述的提示信息,默认是False(默认输出)如果查询不到配置文件,将采取以下配置