I made an oopsie
This commit is contained in:
parent
b6dfbe8a19
commit
f4dac46747
|
@ -12,7 +12,7 @@ mod discord;
|
||||||
const MAXBUF: u64 = 8_380_416;
|
const MAXBUF: u64 = 8_380_416;
|
||||||
|
|
||||||
const HELP: &[&str] = &[
|
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 config <webhook_url> - set webhook",
|
||||||
"dimgup-cli <file> - upload file to discord",
|
"dimgup-cli <file> - upload file to discord",
|
||||||
"dimgup-cli help - show this message",
|
"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<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
let filename = std::env::args()
|
let filename = std::env::args()
|
||||||
.nth(1)
|
.nth(1)
|
||||||
.ok_or_else(|| anyhow!("No filename was provided"))?;
|
.ok_or_else(|| anyhow!("No filename or argument was provided"))?;
|
||||||
if filename == "config" {
|
if filename == "config" {
|
||||||
let webhook = std::env::args()
|
let webhook = std::env::args()
|
||||||
.nth(2)
|
.nth(2)
|
||||||
|
@ -99,7 +99,7 @@ fn main() -> anyhow::Result<()> {
|
||||||
let conf = get_config_file();
|
let conf = get_config_file();
|
||||||
let webhook = match get_webhook(&conf) {
|
let webhook = match get_webhook(&conf) {
|
||||||
Ok(w) => w,
|
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);
|
let filename = PathBuf::from(filename);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue