Created
November 9, 2018 20:59
-
-
Save tvaisanen/7f7b8532410d26b7bc57c81d8f895605 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fs::OpenOptions; | |
| fn main() { | |
| // read the command line arguments | |
| // and skip the first one, which | |
| // is the command itself | |
| for arg in std::env::args().skip(1) { | |
| // get the filename from arg | |
| let filename = format!("{}.js", arg); | |
| // create the file | |
| let _file = OpenOptions::new() | |
| .write(true) | |
| .create_new(true) | |
| .open(filename).unwrap(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment