bashkit 0.5.0

Awesomely fast virtual sandbox with bash and file system
Documentation
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@39364b6 src/uu/readlink/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> readlink <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.

#![allow(unused_imports, dead_code)]
use clap::{Arg, ArgAction, Command, builder::ValueParser};
use std::ffi::OsString;
use std::ops::RangeInclusive;
use std::str::FromStr;
const OPT_CANONICALIZE: &str = "canonicalize";
const OPT_CANONICALIZE_MISSING: &str = "canonicalize-missing";
const OPT_CANONICALIZE_EXISTING: &str = "canonicalize-existing";
const OPT_NO_NEWLINE: &str = "no-newline";
const OPT_QUIET: &str = "quiet";
const OPT_SILENT: &str = "silent";
const OPT_VERBOSE: &str = "verbose";
const OPT_ZERO: &str = "zero";
const ARG_FILES: &str = "files";
/// Vendored stand-in for `uucore::format_usage`.
///
/// Upstream wraps the usage line with stylized "Usage:" prefix logic
/// driven by uucore's locale stack. For our purposes the raw string
/// is enough; clap's `override_usage` accepts the literal as-is.
fn format_usage(s: &str) -> String {
    s.to_string()
}
pub fn readlink_command() -> Command {
    Command::new("readlink")
        .version(env!("CARGO_PKG_VERSION"))
        .about(
            ::std::string::String::from(
                "Print value of a symbolic link or canonical file name.",
            ),
        )
        .override_usage(
            format_usage(&::std::string::String::from("readlink [OPTION]... [FILE]...")),
        )
        .infer_long_args(true)
        .arg(
            Arg::new(OPT_CANONICALIZE)
                .short('f')
                .long(OPT_CANONICALIZE)
                .help(
                    ::std::string::String::from(
                        "canonicalize by following every symlink in every component of the given name recursively; all but the last component must exist",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(OPT_CANONICALIZE_EXISTING)
                .short('e')
                .long("canonicalize-existing")
                .help(
                    ::std::string::String::from(
                        "canonicalize by following every symlink in every component of the given name recursively, all components must exist",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(OPT_CANONICALIZE_MISSING)
                .short('m')
                .long(OPT_CANONICALIZE_MISSING)
                .help(
                    ::std::string::String::from(
                        "canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(OPT_NO_NEWLINE)
                .short('n')
                .long(OPT_NO_NEWLINE)
                .help(
                    ::std::string::String::from("do not output the trailing delimiter"),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(OPT_QUIET)
                .short('q')
                .long(OPT_QUIET)
                .help(::std::string::String::from("suppress most error messages"))
                .overrides_with_all([OPT_QUIET, OPT_SILENT, OPT_VERBOSE])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(OPT_SILENT)
                .short('s')
                .long(OPT_SILENT)
                .help(::std::string::String::from("suppress most error messages"))
                .overrides_with_all([OPT_QUIET, OPT_SILENT, OPT_VERBOSE])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(OPT_VERBOSE)
                .short('v')
                .long(OPT_VERBOSE)
                .help(::std::string::String::from("report error message"))
                .overrides_with_all([OPT_QUIET, OPT_SILENT, OPT_VERBOSE])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(OPT_ZERO)
                .short('z')
                .long(OPT_ZERO)
                .help(
                    ::std::string::String::from(
                        "separate output with NUL rather than newline",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(ARG_FILES)
                .action(ArgAction::Append)
                .value_parser(clap::value_parser!(OsString))
                .value_hint(clap::ValueHint::AnyPath),
        )
}