#[macro_use(crate_version, crate_authors)]
extern crate clap;

use clap::{App, Arg};

use std::fs::File;
use std::io::{Read, BufReader};

fn main() {

    let matches = App::new("aux2bib")
                        .version(crate_version!())
                        .author(crate_authors!(",\n"))
                        .about("gets BibTeX keys from Inspire")
                        .arg(Arg::with_name("INPUT")
                             .help("Sets the input file to use")
                             .index(1))
                        .arg(Arg::with_name("OUTPUT")
                            .help("Sets the output file to use")
                            .index(2))
                        .get_matches();

    // Get input from specified file or stdin
    let mut input_data = String::new();

    match matches.value_of("INPUT") {
        Some(input_file_name) => {
            println!("Reading from file: {}", input_file_name);

            let f = File::open(input_file_name).expect("File not found");
            let mut reader = BufReader::new(f);
            reader.read_to_string(&mut input_data).unwrap();
        },
        None => {
            println!("Reading from stdin");

            let stdin = std::io::stdin();
            let stdin = stdin.lock();

            let mut reader = BufReader::new(stdin);
            reader.read_to_string(&mut input_data).unwrap();
        }
    }
}

#[macro_use(crate_version, crate_authors)]
extern crate clap;

use clap::{App, Arg};

fn main() {

    let matches = App::new("aux2bib")
                        .version(crate_version!())
                        .author(crate_authors!(",\n"))
                        .about("gets BibTeX keys from Inspire")
                        .arg(Arg::with_name("INPUT")
                             .help("Sets the input file to use")
                             .index(1))
                        .arg(Arg::with_name("OUTPUT")
                            .help("Sets the output file to use")
                            .index(2))
                        .get_matches();
}

--- 
+++ 
@@ -2,6 +2,9 @@
 extern crate clap;
 
 use clap::{App, Arg};
+
+use std::fs::File;
+use std::io::{Read, BufReader};
 
 fn main() {
 
@@ -16,4 +19,26 @@
                             .help("Sets the output file to use")
                             .index(2))
                         .get_matches();
+
+    // Get input from specified file or stdin
+    let mut input_data = String::new();
+
+    match matches.value_of("INPUT") {
+        Some(input_file_name) => {
+            println!("Reading from file: {}", input_file_name);
+
+            let f = File::open(input_file_name).expect("File not found");
+            let mut reader = BufReader::new(f);
+            reader.read_to_string(&mut input_data).unwrap();
+        },
+        None => {
+            println!("Reading from stdin");
+
+            let stdin = std::io::stdin();
+            let stdin = stdin.lock();
+
+            let mut reader = BufReader::new(stdin);
+            reader.read_to_string(&mut input_data).unwrap();
+        }
+    }
 }
Add rough handling of input

Would be nice to move creation and use of reader out of the `match`.
