main.rs 495 B

1234567891011121314151617181920
  1. // Copyright (C) 2015, Alberto Corona <alberto@0x1a.us>
  2. // All rights reserved. This file is part of core-utils, distributed under the
  3. // GPL v3 license. For full terms please see the LICENSE file.
  4. #![crate_type = "bin"]
  5. use std::env;
  6. fn print_help() {
  7. println!("\tpwd -- output the current working directory");
  8. }
  9. fn main() {
  10. let args = env::args_os();
  11. if args.len() != 1 {
  12. print_help();
  13. } else {
  14. println!("{}", env::current_dir().unwrap().display());
  15. }
  16. }