I made an oopsie

This commit is contained in:
Yash Karandikar 2022-04-19 10:57:12 -05:00
parent b6dfbe8a19
commit f4dac46747

View file

@ -12,7 +12,7 @@ mod discord;
const MAXBUF: u64 = 8_380_416;
const HELP: &[&str] = &[
concat!("dimgup-cli ", env!("CARGO_PKG_VERSION")),
concat!("+---- dimgup-cli ", env!("CARGO_PKG_VERSION"), " ---+"),
"dimgup-cli config <webhook_url> - set webhook",
"dimgup-cli <file> - upload file to discord",
"dimgup-cli help - show this message",
@ -83,7 +83,7 @@ fn do_upload(mut file: File, size: u64, name: &str, webhook: &str) -> anyhow::Re
fn main() -> anyhow::Result<()> {
let filename = std::env::args()
.nth(1)
.ok_or_else(|| anyhow!("No filename was provided"))?;
.ok_or_else(|| anyhow!("No filename or argument was provided"))?;
if filename == "config" {
let webhook = std::env::args()
.nth(2)
@ -99,7 +99,7 @@ fn main() -> anyhow::Result<()> {
let conf = get_config_file();
let webhook = match get_webhook(&conf) {
Ok(w) => w,
Err(_) => bail!("Please set your webhook. See --help for more info."),
Err(_) => bail!("Please set your webhook. See `dimgup-cli help` for more info."),
};
let filename = PathBuf::from(filename);