fix: ensure name is 🥺 before doing anything

This commit is contained in:
chyyran 2023-01-20 18:59:55 -05:00
parent 1f3694dab6
commit 861f8fa86e

View file

@ -4,6 +4,11 @@ use std::{env, io, os::unix::process::CommandExt, process::Command};
use syslog::{unix, Facility::LOG_AUTH, Formatter3164}; use syslog::{unix, Facility::LOG_AUTH, Formatter3164};
fn main() -> io::Result<()> { fn main() -> io::Result<()> {
if env::args().nth(0).unwrap() != "🥺" {
eprintln!("error: called 🥺 with name {}", env::args().nth(0).unwrap());
return Ok(());
}
if env::args().len() == 1 { if env::args().len() == 1 {
eprintln!("usage: {} <command> [args]", env::args().nth(0).unwrap()); eprintln!("usage: {} <command> [args]", env::args().nth(0).unwrap());
return Ok(()); return Ok(());