Extremely sus!

This commit is contained in:
TheTechRobo 2022-02-17 11:33:47 -05:00
parent 8cde32d3f6
commit eca6ca36c3
3 changed files with 10 additions and 4 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
testing/

View File

@ -1,6 +1,6 @@
[package]
name = "intern"
version = "0.2.0"
version = "0.2.2"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -9,8 +9,6 @@ extern crate clap;
use clap::{Arg, App, SubCommand};
fn main() {
let mut identifier = String::new();
let mut title = String::new();
let matches = App::new("intern")
.version("1.0")
.author("TheTechRobo")
@ -30,6 +28,7 @@ fn main() {
.arg(Arg::with_name("FILES")
.help("Files to upload")
.required(true)
.multiple(true)
.index(4))
.arg(Arg::with_name("metadata")
.short('m')
@ -55,6 +54,7 @@ fn main() {
//println!("{:?}", raw_metadata);
let item_type = matches.value_of("TYPE").unwrap();
let title = matches.value_of("TITLE").unwrap();
let identifier = matches.value_of("IDENTIFIER").unwrap();
let mut metadata = HashMap::new();
if item_type == "web" {
metadata.insert(
@ -99,16 +99,21 @@ fn main() {
}
// Setup variables for printing
let files: Vec<&str> = matches.values_of("FILES").unwrap().collect();
let tool = "ia upload";
let mut options_files = "".to_string();
let mut options_metadata = "".to_string();
let mut extra_options = "".to_string();
for file in files {
options_files = format!("{} {}", options_files, file);
}
for option in raw_options {
extra_options = format!("{} {}", extra_options, option);
}
for (key, value) in &metadata {
options_metadata = format!("{} --metadata \"{}:{}\"", options_metadata, key, value);
}
println!("{} {} {}", tool, options_metadata, extra_options);
println!("{} {} {} {} {}", tool, options_metadata, identifier, options_files, extra_options);
//println!("{}", identifier);
}