update help dialog
This commit is contained in:
parent
05275d864c
commit
875481b9a2
12
src/args.rs
12
src/args.rs
|
@ -2,7 +2,7 @@ use clap::{App, Arg};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct AppArgs {
|
pub struct AppArgs {
|
||||||
pub url_target: String,
|
pub target: String,
|
||||||
pub no_css: bool,
|
pub no_css: bool,
|
||||||
pub no_frames: bool,
|
pub no_frames: bool,
|
||||||
pub no_images: bool,
|
pub no_images: bool,
|
||||||
|
@ -26,11 +26,11 @@ impl AppArgs {
|
||||||
.author(crate_authors!("\n"))
|
.author(crate_authors!("\n"))
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("url")
|
Arg::with_name("target")
|
||||||
.required(true)
|
.required(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.index(1)
|
.index(1)
|
||||||
.help("URL to download"),
|
.help("URL or file path"),
|
||||||
)
|
)
|
||||||
// .args_from_usage("-a, --include-audio 'Removes audio sources'")
|
// .args_from_usage("-a, --include-audio 'Removes audio sources'")
|
||||||
.args_from_usage("-c, --no-css 'Removes CSS'")
|
.args_from_usage("-c, --no-css 'Removes CSS'")
|
||||||
|
@ -47,9 +47,9 @@ impl AppArgs {
|
||||||
.get_matches();
|
.get_matches();
|
||||||
let mut app_args = AppArgs::default();
|
let mut app_args = AppArgs::default();
|
||||||
// Process the command
|
// Process the command
|
||||||
app_args.url_target = app
|
app_args.target = app
|
||||||
.value_of("url")
|
.value_of("target")
|
||||||
.expect("please set target url")
|
.expect("please set target")
|
||||||
.to_string();
|
.to_string();
|
||||||
app_args.no_css = app.is_present("no-css");
|
app_args.no_css = app.is_present("no-css");
|
||||||
app_args.no_frames = app.is_present("no-frames");
|
app_args.no_frames = app.is_present("no-frames");
|
||||||
|
|
|
@ -47,7 +47,7 @@ impl Output {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let app_args = AppArgs::get();
|
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 target_url: &str;
|
||||||
let base_url;
|
let base_url;
|
||||||
let dom;
|
let dom;
|
||||||
|
|
Loading…
Reference in New Issue