Code formatting
This commit is contained in:
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
pub fn print_help() {
|
pub fn print_help() {
|
||||||
let msg: String = String::from(
|
let msg: String = String::from(
|
||||||
r#"icd [Action] [flag]
|
r#"icd [Action] [flag]
|
||||||
@@ -35,4 +33,4 @@ pub fn print_help() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
println!("{}", msg);
|
println!("{}", msg);
|
||||||
}
|
}
|
||||||
|
|||||||
-46
@@ -7,52 +7,6 @@ mod syncers;
|
|||||||
mod utilities;
|
mod utilities;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
// use std::process;
|
|
||||||
|
|
||||||
/*
|
|
||||||
fn exit_program(code: i32) {
|
|
||||||
process::exit(code);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
fn print_help() {
|
|
||||||
let msg: String = String::from(
|
|
||||||
r#"icd [Action] [flag]
|
|
||||||
|
|
||||||
Actions
|
|
||||||
download
|
|
||||||
upload-meta
|
|
||||||
retrieve
|
|
||||||
delete
|
|
||||||
|
|
||||||
Flags
|
|
||||||
Required for all actions
|
|
||||||
-u username
|
|
||||||
-p password
|
|
||||||
-h host
|
|
||||||
|
|
||||||
Required for upload with metadata
|
|
||||||
-s path of song
|
|
||||||
-t track number
|
|
||||||
-m metadata filepath
|
|
||||||
-ca coverart filepath
|
|
||||||
-scma directory where songs, metadata, and cover art exists and will be uploaded (Optional)
|
|
||||||
|
|
||||||
Required for download
|
|
||||||
-b song id
|
|
||||||
-d path to download song (Optional)
|
|
||||||
|
|
||||||
Required for retrieving records
|
|
||||||
-rt retrieve type (songs is only accepted)
|
|
||||||
|
|
||||||
Required for deleting a song
|
|
||||||
-D song id"#,
|
|
||||||
);
|
|
||||||
|
|
||||||
println!("{}", msg);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
|
|||||||
@@ -27,15 +27,21 @@ impl UserManager {
|
|||||||
pub fn parse_user_from_actions(&mut self) {
|
pub fn parse_user_from_actions(&mut self) {
|
||||||
let args = &self.ica_action.flags;
|
let args = &self.ica_action.flags;
|
||||||
|
|
||||||
|
// Quit the loop when two are found
|
||||||
|
let mut amt: i32 = 0;
|
||||||
for arg in args {
|
for arg in args {
|
||||||
let flag = &arg.flag;
|
let flag = &arg.flag;
|
||||||
|
|
||||||
if flag == "-u" {
|
if flag == "-u" {
|
||||||
self.user.username = String::from(&arg.value);
|
self.user.username = String::from(&arg.value);
|
||||||
|
amt += 1;
|
||||||
|
} else if flag == "-p" {
|
||||||
|
self.user.password = String::from(&arg.value);
|
||||||
|
amt += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if flag == "-p" {
|
if amt == 2 {
|
||||||
self.user.password = String::from(&arg.value);
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ impl Checks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn exit_program(code: i32) {
|
pub fn exit_program(code: i32) {
|
||||||
std::process::exit(code);
|
std::process::exit(code);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user