Improve the plm instance new command
Add long arguments Fix the help messages Actually write to StdOut when needed Fallback to BASE_URL first if domain is not specified
This commit is contained in:
@@ -5,7 +5,7 @@ extern crate plume_models;
|
||||
|
||||
use clap::App;
|
||||
use diesel::{Connection, PgConnection};
|
||||
use std::io::{self, Write};
|
||||
use std::io::{self, prelude::*};
|
||||
use plume_models::DB_URL;
|
||||
|
||||
mod instance;
|
||||
@@ -28,8 +28,8 @@ fn main() {
|
||||
}
|
||||
|
||||
pub fn ask_for(something: &str) -> String {
|
||||
write!(io::stdout(), "{}", something).ok();
|
||||
write!(io::stdout(), ": ").ok();
|
||||
print!("{}: ", something);
|
||||
io::stdout().flush().expect("Couldn't flush STDOUT");
|
||||
let mut input = String::new();
|
||||
io::stdin().read_line(&mut input).expect("Unable to read line");
|
||||
input.retain(|c| c != '\n');
|
||||
|
||||
Reference in New Issue
Block a user