Fix: Replace deprecated Arg::help() call with Arg::about()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2021-10-27 08:35:01 +00:00
parent 9ece0fa0be
commit 26ceda4aa4
2 changed files with 33 additions and 33 deletions

View file

@ -45,25 +45,25 @@ pub fn build_app<'a>() -> App<'a> {
.about("Build a binary from the given .roc file, but don't run it") .about("Build a binary from the given .roc file, but don't run it")
.arg( .arg(
Arg::with_name(ROC_FILE) Arg::with_name(ROC_FILE)
.help("The .roc file to build") .about("The .roc file to build")
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(FLAG_OPTIMIZE) Arg::with_name(FLAG_OPTIMIZE)
.long(FLAG_OPTIMIZE) .long(FLAG_OPTIMIZE)
.help("Optimize your compiled Roc program to run faster. (Optimization takes time to complete.)") .about("Optimize your compiled Roc program to run faster. (Optimization takes time to complete.)")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_DEV) Arg::with_name(FLAG_DEV)
.long(FLAG_DEV) .long(FLAG_DEV)
.help("Make compilation as fast as possible. (Runtime performance may suffer)") .about("Make compilation as fast as possible. (Runtime performance may suffer)")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_BACKEND) Arg::with_name(FLAG_BACKEND)
.long(FLAG_BACKEND) .long(FLAG_BACKEND)
.help("Choose a different backend") .about("Choose a different backend")
// .requires(BACKEND) // .requires(BACKEND)
.default_value(Backend::default().as_str()) .default_value(Backend::default().as_str())
.possible_values(Backend::OPTIONS) .possible_values(Backend::OPTIONS)
@ -72,31 +72,31 @@ pub fn build_app<'a>() -> App<'a> {
.arg( .arg(
Arg::with_name(FLAG_LIB) Arg::with_name(FLAG_LIB)
.long(FLAG_LIB) .long(FLAG_LIB)
.help("Build a C library instead of an executable.") .about("Build a C library instead of an executable.")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_DEBUG) Arg::with_name(FLAG_DEBUG)
.long(FLAG_DEBUG) .long(FLAG_DEBUG)
.help("Store LLVM debug information in the generated program") .about("Store LLVM debug information in the generated program")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_TIME) Arg::with_name(FLAG_TIME)
.long(FLAG_TIME) .long(FLAG_TIME)
.help("Prints detailed compilation time information.") .about("Prints detailed compilation time information.")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_LINK) Arg::with_name(FLAG_LINK)
.long(FLAG_LINK) .long(FLAG_LINK)
.help("Uses the roc linker instead of the system linker.") .about("Uses the roc linker instead of the system linker.")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_PRECOMPILED) Arg::with_name(FLAG_PRECOMPILED)
.long(FLAG_PRECOMPILED) .long(FLAG_PRECOMPILED)
.help("Assumes the host has been precompiled and skips recompiling the host.") .about("Assumes the host has been precompiled and skips recompiling the host.")
.required(false), .required(false),
) )
) )
@ -108,12 +108,12 @@ pub fn build_app<'a>() -> App<'a> {
.arg( .arg(
Arg::with_name(FLAG_TIME) Arg::with_name(FLAG_TIME)
.long(FLAG_TIME) .long(FLAG_TIME)
.help("Prints detailed compilation time information.") .about("Prints detailed compilation time information.")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(ROC_FILE) Arg::with_name(ROC_FILE)
.help("The .roc file of an app to run") .about("The .roc file of an app to run")
.required(true), .required(true),
) )
) )
@ -124,7 +124,7 @@ pub fn build_app<'a>() -> App<'a> {
.index(1) .index(1)
.multiple(true) .multiple(true)
.required(false) .required(false)
.help("The directory or files to build documentation for") .about("The directory or files to build documentation for")
) )
) )
@ -132,45 +132,45 @@ pub fn build_app<'a>() -> App<'a> {
.arg( .arg(
Arg::with_name(FLAG_OPTIMIZE) Arg::with_name(FLAG_OPTIMIZE)
.long(FLAG_OPTIMIZE) .long(FLAG_OPTIMIZE)
.help("Optimize the compiled program to run faster. (Optimization takes time to complete.)") .about("Optimize the compiled program to run faster. (Optimization takes time to complete.)")
.requires(ROC_FILE) .requires(ROC_FILE)
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_DEV) Arg::with_name(FLAG_DEV)
.long(FLAG_DEV) .long(FLAG_DEV)
.help("Make compilation as fast as possible. (Runtime performance may suffer)") .about("Make compilation as fast as possible. (Runtime performance may suffer)")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_DEBUG) Arg::with_name(FLAG_DEBUG)
.long(FLAG_DEBUG) .long(FLAG_DEBUG)
.help("Store LLVM debug information in the generated program") .about("Store LLVM debug information in the generated program")
.requires(ROC_FILE) .requires(ROC_FILE)
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_TIME) Arg::with_name(FLAG_TIME)
.long(FLAG_TIME) .long(FLAG_TIME)
.help("Prints detailed compilation time information.") .about("Prints detailed compilation time information.")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_LINK) Arg::with_name(FLAG_LINK)
.long(FLAG_LINK) .long(FLAG_LINK)
.help("Uses the roc linker instead of the system linker.") .about("Uses the roc linker instead of the system linker.")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_PRECOMPILED) Arg::with_name(FLAG_PRECOMPILED)
.long(FLAG_PRECOMPILED) .long(FLAG_PRECOMPILED)
.help("Assumes the host has been precompiled and skips recompiling the host.") .about("Assumes the host has been precompiled and skips recompiling the host.")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_BACKEND) Arg::with_name(FLAG_BACKEND)
.long(FLAG_BACKEND) .long(FLAG_BACKEND)
.help("Choose a different backend") .about("Choose a different backend")
// .requires(BACKEND) // .requires(BACKEND)
.default_value(Backend::default().as_str()) .default_value(Backend::default().as_str())
.possible_values(Backend::OPTIONS) .possible_values(Backend::OPTIONS)
@ -178,12 +178,12 @@ pub fn build_app<'a>() -> App<'a> {
) )
.arg( .arg(
Arg::with_name(ROC_FILE) Arg::with_name(ROC_FILE)
.help("The .roc file of an app to build and run") .about("The .roc file of an app to build and run")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(ARGS_FOR_APP) Arg::with_name(ARGS_FOR_APP)
.help("Arguments to pass into the app being run") .about("Arguments to pass into the app being run")
.requires(ROC_FILE) .requires(ROC_FILE)
.multiple(true), .multiple(true),
); );
@ -195,7 +195,7 @@ pub fn build_app<'a>() -> App<'a> {
.index(1) .index(1)
.multiple(true) .multiple(true)
.required(false) .required(false)
.help("(optional) The directory or files to open on launch."), .about("(optional) The directory or files to open on launch."),
), ),
) )
} else { } else {

View file

@ -59,36 +59,36 @@ pub fn build_app<'a>() -> App<'a> {
.about("Preprocesses a dynamically linked platform to prepare for linking.") .about("Preprocesses a dynamically linked platform to prepare for linking.")
.arg( .arg(
Arg::with_name(EXEC) Arg::with_name(EXEC)
.help("The dynamically linked platform executable") .about("The dynamically linked platform executable")
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(METADATA) Arg::with_name(METADATA)
.help("Where to save the metadata from preprocessing") .about("Where to save the metadata from preprocessing")
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(OUT) Arg::with_name(OUT)
.help("The modified version of the dynamically linked platform executable") .about("The modified version of the dynamically linked platform executable")
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(SHARED_LIB) Arg::with_name(SHARED_LIB)
.help("The name of the shared library used in building the platform") .about("The name of the shared library used in building the platform")
.default_value("libapp.so"), .default_value("libapp.so"),
) )
.arg( .arg(
Arg::with_name(FLAG_VERBOSE) Arg::with_name(FLAG_VERBOSE)
.long(FLAG_VERBOSE) .long(FLAG_VERBOSE)
.short('v') .short('v')
.help("Enable verbose printing") .about("Enable verbose printing")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_TIME) Arg::with_name(FLAG_TIME)
.long(FLAG_TIME) .long(FLAG_TIME)
.short('t') .short('t')
.help("Print timing information") .about("Print timing information")
.required(false), .required(false),
), ),
) )
@ -97,17 +97,17 @@ pub fn build_app<'a>() -> App<'a> {
.about("Links a preprocessed platform with a Roc application.") .about("Links a preprocessed platform with a Roc application.")
.arg( .arg(
Arg::with_name(APP) Arg::with_name(APP)
.help("The Roc application object file waiting to be linked") .about("The Roc application object file waiting to be linked")
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(METADATA) Arg::with_name(METADATA)
.help("The metadata created by preprocessing the platform") .about("The metadata created by preprocessing the platform")
.required(true), .required(true),
) )
.arg( .arg(
Arg::with_name(OUT) Arg::with_name(OUT)
.help( .about(
"The modified version of the dynamically linked platform. \ "The modified version of the dynamically linked platform. \
It will be consumed to make linking faster.", It will be consumed to make linking faster.",
) )
@ -117,14 +117,14 @@ pub fn build_app<'a>() -> App<'a> {
Arg::with_name(FLAG_VERBOSE) Arg::with_name(FLAG_VERBOSE)
.long(FLAG_VERBOSE) .long(FLAG_VERBOSE)
.short('v') .short('v')
.help("Enable verbose printing") .about("Enable verbose printing")
.required(false), .required(false),
) )
.arg( .arg(
Arg::with_name(FLAG_TIME) Arg::with_name(FLAG_TIME)
.long(FLAG_TIME) .long(FLAG_TIME)
.short('t') .short('t')
.help("Print timing information") .about("Print timing information")
.required(false), .required(false),
), ),
) )