1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
Index: rustyline/Cargo.toml
===================================================================
--- rustyline.orig/Cargo.toml
+++ rustyline/Cargo.toml
@@ -73,9 +73,6 @@ version = "0.3"
version = "0.9"
default-features = false
-[dev-dependencies.rustyline-derive]
-version = "0.6.0"
-
[dev-dependencies.tempfile]
version = "3.1.0"
Index: rustyline/examples/diy_hints.rs
===================================================================
--- rustyline.orig/examples/diy_hints.rs
+++ rustyline/examples/diy_hints.rs
@@ -3,7 +3,7 @@ use std::collections::HashSet;
use rustyline::hint::{Hint, Hinter};
use rustyline::Context;
use rustyline::{Editor, Result};
-use rustyline_derive::{Completer, Helper, Highlighter, Validator};
+/*use rustyline_derive::{Completer, Helper, Highlighter, Validator};
#[derive(Completer, Helper, Validator, Highlighter)]
struct DIYHinter {
@@ -79,10 +79,10 @@ fn diy_hints() -> HashSet<CommandHint> {
set.insert(CommandHint::new("hget key field", "hget "));
set.insert(CommandHint::new("hset key field value", "hset "));
set
-}
+}*/
fn main() -> Result<()> {
- println!("This is a DIY hint hack of rustyline");
+ /*println!("This is a DIY hint hack of rustyline");
let h = DIYHinter { hints: diy_hints() };
let mut rl: Editor<DIYHinter> = Editor::new();
@@ -91,5 +91,6 @@ fn main() -> Result<()> {
loop {
let input = rl.readline("> ")?;
println!("input: {}", input);
- }
+ }*/
+ Ok(())
}
Index: rustyline/examples/example.rs
===================================================================
--- rustyline.orig/examples/example.rs
+++ rustyline/examples/example.rs
@@ -7,7 +7,7 @@ use rustyline::highlight::{Highlighter,
use rustyline::hint::{Hinter, HistoryHinter};
use rustyline::validate::{self, MatchingBracketValidator, Validator};
use rustyline::{Cmd, CompletionType, Config, Context, EditMode, Editor, KeyEvent};
-use rustyline_derive::Helper;
+/*use rustyline_derive::Helper;
#[derive(Helper)]
struct MyHelper {
@@ -77,11 +77,11 @@ impl Validator for MyHelper {
self.validator.validate_while_typing()
}
}
-
+*/
// To debug rustyline:
// RUST_LOG=rustyline=debug cargo run --example example 2> debug.log
fn main() -> rustyline::Result<()> {
- env_logger::init();
+ /*env_logger::init();
let config = Config::builder()
.history_ignore_space(true)
.completion_type(CompletionType::List)
@@ -127,5 +127,6 @@ fn main() -> rustyline::Result<()> {
}
count += 1;
}
- rl.append_history("history.txt")
+ rl.append_history("history.txt")*/
+ Ok(())
}
Index: rustyline/examples/input_validation.rs
===================================================================
--- rustyline.orig/examples/input_validation.rs
+++ rustyline/examples/input_validation.rs
@@ -1,6 +1,6 @@
use rustyline::validate::{ValidationContext, ValidationResult, Validator};
use rustyline::{Editor, Result};
-use rustyline_derive::{Completer, Helper, Highlighter, Hinter};
+/*use rustyline_derive::{Completer, Helper, Highlighter, Hinter};
#[derive(Completer, Helper, Highlighter, Hinter)]
struct InputValidator {}
@@ -18,14 +18,14 @@ impl Validator for InputValidator {
};
Ok(result)
}
-}
+}*/
fn main() -> Result<()> {
- let h = InputValidator {};
+ /*let h = InputValidator {};
let mut rl = Editor::new();
rl.set_helper(Some(h));
let input = rl.readline("> ")?;
- println!("Input: {}", input);
+ println!("Input: {}", input);*/
Ok(())
}
Index: rustyline/examples/read_password.rs
===================================================================
--- rustyline.orig/examples/read_password.rs
+++ rustyline/examples/read_password.rs
@@ -3,7 +3,7 @@ use std::borrow::Cow::{self, Borrowed, O
use rustyline::config::Configurer;
use rustyline::highlight::Highlighter;
use rustyline::{ColorMode, Editor, Result};
-use rustyline_derive::{Completer, Helper, Hinter, Validator};
+/*use rustyline_derive::{Completer, Helper, Hinter, Validator};
#[derive(Completer, Helper, Hinter, Validator)]
struct MaskingHighlighter {
@@ -23,10 +23,10 @@ impl Highlighter for MaskingHighlighter
fn highlight_char(&self, _line: &str, _pos: usize) -> bool {
self.masking
}
-}
+}*/
fn main() -> Result<()> {
- println!("This is just a hack. Reading passwords securely requires more than that.");
+ /*println!("This is just a hack. Reading passwords securely requires more than that.");
let h = MaskingHighlighter { masking: false };
let mut rl = Editor::new();
rl.set_helper(Some(h));
@@ -38,6 +38,6 @@ fn main() -> Result<()> {
rl.set_color_mode(ColorMode::Forced); // force masking
rl.set_auto_add_history(false); // make sure password is not added to history
let passwd = rl.readline("Password:")?;
- println!("Secret: {}", passwd);
+ println!("Secret: {}", passwd);*/
Ok(())
}
Index: rustyline/examples/custom_key_bindings.rs
===================================================================
--- rustyline.orig/examples/custom_key_bindings.rs
+++ rustyline/examples/custom_key_bindings.rs
@@ -7,7 +7,7 @@ use rustyline::{
Cmd, ConditionalEventHandler, Context, Editor, Event, EventContext, EventHandler, KeyEvent,
RepeatCount, Result,
};
-use rustyline_derive::{Completer, Helper, Validator};
+/*use rustyline_derive::{Completer, Helper, Validator};
#[derive(Completer, Helper, Validator)]
struct MyHelper(HistoryHinter);
@@ -91,10 +91,10 @@ impl ConditionalEventHandler for TabEven
None // default complete
}
}
-}
+}*/
fn main() -> Result<()> {
- let mut rl = Editor::<MyHelper>::new();
+ /*let mut rl = Editor::<MyHelper>::new();
rl.set_helper(Some(MyHelper(HistoryHinter {})));
let ceh = Box::new(CompleteHintHandler);
@@ -113,5 +113,6 @@ fn main() -> Result<()> {
let line = rl.readline("> ")?;
rl.add_history_entry(line.as_str());
println!("Line: {}", line);
- }
+ }*/
+ Ok(())
}
Index: rustyline/examples/input_multiline.rs
===================================================================
--- rustyline.orig/examples/input_multiline.rs
+++ rustyline/examples/input_multiline.rs
@@ -2,7 +2,7 @@ use rustyline::validate::{
MatchingBracketValidator, ValidationContext, ValidationResult, Validator,
};
use rustyline::{Editor, Result};
-use rustyline_derive::{Completer, Helper, Highlighter, Hinter};
+/*use rustyline_derive::{Completer, Helper, Highlighter, Hinter};
#[derive(Completer, Helper, Highlighter, Hinter)]
struct InputValidator {
@@ -13,10 +13,10 @@ impl Validator for InputValidator {
fn validate(&self, ctx: &mut ValidationContext) -> Result<ValidationResult> {
self.brackets.validate(ctx)
}
-}
+}*/
fn main() -> Result<()> {
- let h = InputValidator {
+ /*let h = InputValidator {
brackets: MatchingBracketValidator::new(),
};
let mut rl = Editor::new();
@@ -24,6 +24,6 @@ fn main() -> Result<()> {
let input = rl.readline("> ")?;
println!("Input: {}", input);
-
+ */
Ok(())
}
|