You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use gumdrop::Options;use std::{env, fs, process};#[derive(Debug,Options)]structArgs{#[options(help = "Prints the version", short = "v", long = "version")]version:bool,#[options(help = "Calls the list_imports function with a filename", short = "l", long = "list-imports")]list_imports:Option<String>,#[options(help = "Updates DLL bindings for <from> so it points to <to>", short = "s", long = "set-import")]set_import:bool,#[options(free)]free_args:Vec<String>,#[options(help = "Print this help message and exit", short = "h")]help:bool,}fnmain(){let args = Args::parse_args_default_or_exit();if args.help{println!("{}",Args::usage());return;}if args.version{println!("fixPath version 1.0");// FIXME read from cargo.toml}elseifletSome(filename) = args.list_imports{println!("{}", filename);}elseif args.set_import{if args.free_args.len() == 3{println!("set-import: {}, {}, {}",
args.free_args[0], args.free_args[1], args.free_args[2]);}else{eprintln!("Error: --set-import requires exactly 3 arguments.");}}else{eprintln!("Error: one of --version, --list-imports or --set-import must be provided.");println!("{}",Args::usage());
process::exit(1);}}
why does the text LIST-IMPORTS in call caps appear?!
.\fixPath.exe -h
Usage: C:\Users\joschie\Desktop\Projects\fixPath\target\debug\fixPath.exe [OPTIONS]
Positional arguments:
free_args
Optional arguments:
-v, --version Prints the version
-l, --list-imports LIST-IMPORTS
Prints <file>'s DLL bindings
-s, --set-import Updates <file>'s DLL bindings <from> so it points to <to>
-h, --help Print this help message and exit
With the source below:
why does the text LIST-IMPORTS in call caps appear?!
https://replit.com/@qknight/gumdrop-example#src/main.rs
The text was updated successfully, but these errors were encountered: