add version flag
This commit is contained in:
parent
e802eb480d
commit
fb724ccee4
2 changed files with 11 additions and 3 deletions
|
|
@ -154,7 +154,6 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt
|
|||
** DONE Beta tasks
|
||||
(See tag: v0.3.0)
|
||||
** TODO v1.0 tasks
|
||||
- Version flag
|
||||
- islist type query
|
||||
- Can pass args to relish scripts (via interpreter)
|
||||
- Can pass args to relish scripts (via command line)
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ use {
|
|||
path::{PathBuf, Path},
|
||||
},
|
||||
reedline::{
|
||||
FileBackedHistory, DefaultHinter, DefaultValidator,
|
||||
Reedline, Signal, Prompt, PromptEditMode, PromptHistorySearch,
|
||||
FileBackedHistory, DefaultHinter, Reedline, Signal,
|
||||
Prompt, PromptEditMode, PromptHistorySearch,
|
||||
PromptHistorySearchStatus, Completer, Suggestion, Span,
|
||||
KeyModifiers, KeyCode, ReedlineEvent, Keybindings,
|
||||
ColumnarMenu, Emacs, ReedlineMenu, Validator, ValidationResult,
|
||||
|
|
@ -282,6 +282,15 @@ fn add_menu_keybindings(keybindings: &mut Keybindings) {
|
|||
fn main() {
|
||||
const HIST_FILE: &str = "/.relish_hist";
|
||||
const CONFIG_FILE_DEFAULT: &str = "/.relishrc";
|
||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
if env::args().count() > 1 &&
|
||||
env::args()
|
||||
.collect::<Vec<_>>()
|
||||
.contains(&"--version".to_string()) {
|
||||
println!("Relish {}", VERSION);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// default config file dirs
|
||||
let home_dir = home_dir().unwrap().to_str().unwrap().to_owned();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue