rgardner / bsh-rs Goto Github PK
View Code? Open in Web Editor NEWBash-like shell (builtins, job control, piping) written in Rust
License: Apache License 2.0
Bash-like shell (builtins, job control, piping) written in Rust
License: Apache License 2.0
cargo run
fails with:
Compiling rustyline v3.0.0
error[E0283]: type annotations needed
--> /home/gback/.cargo/registry/src/github.com-1ecc6299db9ec823/rustyline-3.0.0/src/lib.rs:655:43
|
655 | editor.add_history_entry(line.as_ref());
| -----^^^^^^--
| | |
| | cannot infer type for type parameter `T` declared on the trait `AsRef`
| this method call resolves to `&T`
|
= note: cannot satisfy `String: AsRef<_>`
help: use the fully qualified path for the potential candidates
|
655 | editor.add_history_entry(<String as AsRef<OsStr>>::as_ref(line));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655 | editor.add_history_entry(<String as AsRef<Path>>::as_ref(line));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655 | editor.add_history_entry(<String as AsRef<[u8]>>::as_ref(line));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655 | editor.add_history_entry(<String as AsRef<str>>::as_ref(line));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> /home/gback/.cargo/registry/src/github.com-1ecc6299db9ec823/rustyline-3.0.0/src/history.rs:151:28
|
151 | self.add(line?.as_ref()); // TODO truncate to MAX_LINE
| ------^^^^^^--
| | |
| | cannot infer type for type parameter `T` declared on the trait `AsRef`
| this method call resolves to `&T`
|
= note: cannot satisfy `String: AsRef<_>`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0283`.
error: could not compile `rustyline`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
First read-through the license to make sure I understand it completely.
history
: prints last commandshistory -c
clears the historyhistory [n]
display last N entrieshelp
lists all builtins and their signatureshelp [command]
outputs help for a specific commandexit
should alert the user if background processes exist and fail to exitkill [pid]
should a kill process with PID pidTo make it easier to test programs with more complicated arguments, these should be supported:
sleep 1 &
causes the shell to exit immediately because Readline returns errno 5 (I/O error occurred), I think because stdin is in a bad state. Per bash source, a background command with default stdin should be redirected to /dev/null
. But, when I made this change, stdin was still in a bad state - maybe terminal control issues?
Waiting on nix-rust/nix#817 to merge
#[cfg(unix)]
)create_pipe
in execute_command
history -s n
set size of history bufferfg
and bg
printenv
setenv
python test.py 2>out
wait on Windows support to settle first.
!n
- repeat command numbered n in the list of commands (starting at 1)!-n
- repeat last nth command (starting at -1)!string
- searches through history for first item that matches the string (via contains)Better names
I first hit this on Travis when I was using set -e
and set +e
in the install script. I don't understand why removing those lines fixed the error cargo was returning though.
Now I'm hitting this when experiment with cov:
$ cargo +nightly cov clean && cargo +nightly cov test && cargo +nightly cov report --open
...
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running debug/deps/integration_tests-40f703f134d886e1
running 7 tests
test test_exit_normal_large_negative ... test test_exit_normal_large_negative has been running for over 60 seconds
test test_command_not_found ... test test_command_not_found has been running for over 60 seconds
test test_simple_redirects ... test test_simple_redirects has been running for over 60 seconds
test test_stderr_redirect ... test test_stderr_redirect has been running for over 60 seconds
test test_simple_pipeline ... test test_simple_pipeline has been running for over 60 seconds
test test_simple_echo ... test test_simple_echo has been running for over 60 seconds
test test_syntax_error ... test test_syntax_error has been running for over 60 seconds
test test_simple_pipeline ... ok
test test_syntax_error ... ok
test test_simple_redirects ... ok
test test_command_not_found ... ok
test test_stderr_redirect ... ok
test test_simple_echo ... ok
test test_exit_normal_large_negative ... ok
...
Waiting on v2.0.0 to release
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.