update help dialog

pull/141/head
Sunshine 4 years ago
parent 05275d864c
commit 875481b9a2
No known key found for this signature in database
GPG Key ID: B80CA68703CD8AB1

@ -2,7 +2,7 @@ use clap::{App, Arg};
#[derive(Default)]
pub struct AppArgs {
pub url_target: String,
pub target: String,
pub no_css: bool,
pub no_frames: bool,
pub no_images: bool,
@ -26,11 +26,11 @@ impl AppArgs {
.author(crate_authors!("\n"))
.about(crate_description!())
.arg(
Arg::with_name("url")
Arg::with_name("target")
.required(true)
.takes_value(true)
.index(1)
.help("URL to download"),
.help("URL or file path"),
)
// .args_from_usage("-a, --include-audio 'Removes audio sources'")
.args_from_usage("-c, --no-css 'Removes CSS'")
@ -47,9 +47,9 @@ impl AppArgs {
.get_matches();
let mut app_args = AppArgs::default();
// Process the command
app_args.url_target = app
.value_of("url")
.expect("please set target url")
app_args.target = app
.value_of("target")
.expect("please set target")
.to_string();
app_args.no_css = app.is_present("no-css");
app_args.no_frames = app.is_present("no-frames");

@ -47,7 +47,7 @@ impl Output {
fn main() {
let app_args = AppArgs::get();
let original_target: &str = &app_args.url_target;
let original_target: &str = &app_args.target;
let target_url: &str;
let base_url;
let dom;

Loading…
Cancel
Save