Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add simple config for iSearch #17

Closed
wants to merge 4 commits into from

Conversation

candywater
Copy link

@candywater candywater commented May 6, 2024

#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 3
SKIP_SAVE_DB_CONFIRM_MESSAGE can ignore above confirm message. default is false

if there is no config file, then will follow default settings

DEFAULT_CONFIG = {
    "skipSaveDbConfirmMessage": False,
    "defaultSaveDbLevel": "3"
}

#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>>> ', 默认为3
SKIP_SAVE_DB_CONFIRM_MESSAGE 可以忽略(不输出)上述的提示信息,默认是False(默认输出)

如果查询不到配置文件,将采取以下配置

DEFAULT_CONFIG = {
    "skipSaveDbConfirmMessage": False,
    "defaultSaveDbLevel": "3"
}

@candywater
Copy link
Author

abort this PR.
I'll do a total rework from v1.0.2.
once I finished work, if dev owner wants a PR then I'll raise one.

@candywater candywater closed this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant