1extern crate ar;
10
11use std::env;
12use std::fs::File;
13use std::path::Path;
14
15fn main() {
16 let num_args = env::args().count();
17 if num_args != 2 {
18 println!("Usage: symbols <path/to/archive.a>");
19 return;
20 }
21
22 let input_path = env::args().nth(1).unwrap();
23 let input_path = Path::new(&input_path);
24 let input_file =
25 File::open(input_path).expect("failed to open input file");
26 let mut archive = ar::Archive::new(input_file);
27
28 for symbol in archive.symbols().expect("failed to parse symbols") {
29 println!("{}", String::from_utf8_lossy(symbol));
30 }
31}