diff --git a/src/main.rs b/src/main.rs
@@ -14,13 +14,13 @@ fn main() -> io::Result<()> {
let config = match args.len() {
2 => &args[1],
1 => {
- // TODO: Print usage info
eprintln!("ERROR: Expected one command line argument, found none");
+ usage();
exit(1)
},
_ => {
- // TODO: Print usage info
eprintln!("ERROR: Expected one command line argument, found many");
+ usage();
exit(1)
},
};
@@ -188,3 +188,7 @@ fn print_license(f: &mut File) -> io::Result<()> {
writeln!(f, " You should have received a copy of the GNU General Public License")?;
writeln!(f, " along with this program. If not, see <https://www.gnu.org/licenses/>. -->")
}
+
+fn usage() {
+ eprintln!("USAGE: yaggen config.yml");
+}