diff --git a/crates/nu-cli/src/completions/operator_completions.rs b/crates/nu-cli/src/completions/operator_completions.rs index 84c1feb67b..c670988a29 100644 --- a/crates/nu-cli/src/completions/operator_completions.rs +++ b/crates/nu-cli/src/completions/operator_completions.rs @@ -40,57 +40,81 @@ impl Completer for OperatorCompletion { }; let possible_operations = match op { Expr::Int(_) => vec![ - ("+", "Plus / Addition"), - ("-", "Minus / Subtraction"), + ("+", "Add (Plus)"), + ("-", "Subtract (Minus)"), ("*", "Multiply"), ("/", "Divide"), - ("==", "Equal"), - ("!=", "Not Equal"), - ("//", "Floor Division"), - ("<", "Less Than"), - (">", "Greater Than"), - ("<=", "Less Than or Equal to"), - (">=", "Greater Than or Equal to"), - ("mod", "Modulo"), - ("**", "Pow"), - ("bit-or", "bitwise or"), - ("bit-xor", "bitwise exclusive or"), - ("bit-and", "bitwise and"), - ("bit-shl", "bitwise shift left"), - ("bit-shr", "bitwise shift right"), - ], - Expr::String(_) => vec![ - ("=~", "Regex Match / Contains"), - ("!~", "Not Regex Match / Not Contains"), - ("in", "In / Contains (doesn't use regex)"), + ("==", "Equal to"), + ("!=", "Not equal to"), + ("//", "Floor division"), + ("<", "Less than"), + (">", "Greater than"), + ("<=", "Less than or equal to"), + (">=", "Greater than or equal to"), + ("mod", "Floor division remainder (Modulo)"), + ("**", "Power of"), + ("bit-or", "Bitwise OR"), + ("bit-xor", "Bitwise exclusive OR"), + ("bit-and", "Bitwise AND"), + ("bit-shl", "Bitwise shift left"), + ("bit-shr", "Bitwise shift right"), + ("in", "Is a member of (doesn't use regex)"), + ("not-in", "Is not a member of (doesn't use regex)"), ( "++", "Appends two lists, a list and a value, two strings, or two binary values", ), - ("not-in", "Not In / Not Contains (doesn't use regex"), - ("starts-with", "Starts With"), - ("ends-with", "Ends With"), + ], + Expr::String(_) => vec![ + ("=~", "Contains regex match"), + ("!~", "Does not contain regex match"), + ( + "++", + "Appends two lists, a list and a value, two strings, or two binary values", + ), + ("in", "Is a member of (doesn't use regex)"), + ("not-in", "Is not a member of (doesn't use regex)"), + ("starts-with", "Starts with"), + ("ends-with", "Ends with"), ], Expr::Float(_) => vec![ - ("+", "Plus / Addition"), - ("-", "Minus / Subtraction"), + ("+", "Add (Plus)"), + ("-", "Subtract (Minus)"), ("*", "Multiply"), ("/", "Divide"), - ("==", "Equal"), - ("!=", "Not Equal"), - ("//", "Floor Division"), - ("<", "Less Than"), - (">", "Greater Than"), - ("<=", "Less Than or Equal to"), - (">=", "Greater Than or Equal to"), - ("mod", "Modulo"), - ("**", "Pow"), + ("==", "Equal to"), + ("!=", "Not equal to"), + ("//", "Floor division"), + ("<", "Less than"), + (">", "Greater than"), + ("<=", "Less than or equal to"), + (">=", "Greater than or equal to"), + ("mod", "Floor division remainder (Modulo)"), + ("**", "Power of"), + ("in", "Is a member of (doesn't use regex)"), + ("not-in", "Is not a member of (doesn't use regex)"), + ( + "++", + "Appends two lists, a list and a value, two strings, or two binary values", + ), ], Expr::Bool(_) => vec![ - ("and", "Checks if both values are true."), - ("or", "Checks if either value is true."), - ("xor", "Checks if one value is true and the other is false."), - ("not", "Negates a value or expression."), + ( + "and", + "Both values are true (short-circuits when first value is false)", + ), + ( + "or", + "Either value is true (short-circuits when first value is true)", + ), + ("xor", "One value is true and the other is false"), + ("not", "Negates a value or expression"), + ("in", "Is a member of (doesn't use regex)"), + ("not-in", "Is not a member of (doesn't use regex)"), + ( + "++", + "Appends two lists, a list and a value, two strings, or two binary values", + ), ], Expr::FullCellPath(path) => match path.head.expr { Expr::List(_) => vec![(