Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Low-level Rust library for implementing terminal command line interface, like in embedded systems.

NotificationsYou must be signed in to change notification settings

hashmismatch/terminal_cli.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you.

Build Status

Documentation

Example, output only (Rust'sstdout)

// Simple ranged integer propertyletmut num1 =1;// Rust stdout terminalletmut terminal =StdoutTerminal;let options =PromptBufferOptions{echo:true, ..Default::default()};letmut prompt =PromptBuffer::new(options);let input_keys =[Key::Character('h'asu8),Key::Character('e'asu8),Key::Character('l'asu8),Key::Character('p'asu8),Key::Newline];for keyin&input_keys{let p = prompt.handle_key(*key,&mut terminal, |mut m|{ifletSome(mut ctx) = m.command("help"){            ctx.get_terminal().print_line("Help!");}// Provides "num1/get" and "num1/set", with input validationifletSome(mut ctx) = m.property("num1",validate_property_min_max(1,100)){            ctx.apply(&mut num1);}});ifletPromptEvent::Break = p{break;}}

License: MIT/Apache-2.0

About

Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp