2 个不稳定版本

0.2.0 2023年12月29日
0.1.0 2023年12月21日

#2163命令行工具

MIT 许可证

770KB
1.5K SLoC

LineEditor


Crates.io Deps GitHub release GitHub issues GitHub

受reedline、rustyline和其他有趣的行编辑器启发,LineEditor是一个新的跨平台行编辑器实现,旨在提供核心组件,以便您可以构建具有尽可能多定制选项的自定义行编辑器。

animated

animated

[!重要] LineEditor API仍处于实验阶段,可能会在基本功能和设计完成之前从版本到版本进行更改

基本示例

let prompt = StringPrompt::new("prompt> ".to_string());
let line_editor = LineEditor::new(Box::new(prompt));
match line_editor.read_line() {
    Ok(LineEditorResult::Success(buffer)) => {
        
    }
    _ => {}
}

定制示例

许可证

MIT License

Copyright (c) 2023 Amr Hesham

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

依赖项

~0.8–6.5MB
~23K SLoC