Skip to content

Commit c25aa1a

Browse files
authored
Print version and info text when executing the shell (RustPython#5057)
1 parent 3900a08 commit c25aa1a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/shell.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustpython_vm::{
66
compiler::{self, CompileError, CompileErrorType},
77
readline::{Readline, ReadlineResult},
88
scope::Scope,
9-
AsObject, PyResult, VirtualMachine,
9+
version, AsObject, PyResult, VirtualMachine,
1010
};
1111

1212
enum ShellExecResult {
@@ -93,6 +93,15 @@ pub fn run_shell(vm: &VirtualMachine, scope: Scope) -> PyResult<()> {
9393

9494
let mut continuing = false;
9595

96+
println!(
97+
"RustPython {}.{}.{}",
98+
version::MAJOR,
99+
version::MINOR,
100+
version::MICRO,
101+
);
102+
103+
println!("Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.");
104+
96105
loop {
97106
let prompt_name = if continuing { "ps2" } else { "ps1" };
98107
let prompt = vm

0 commit comments

Comments
 (0)