mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tail: Change static global variables to const
This commit is contained in:
parent
48f9786164
commit
d1454628e1
2 changed files with 32 additions and 33 deletions
|
@ -24,22 +24,22 @@ const USAGE: &str = help_usage!("tail.md");
|
|||
|
||||
pub mod options {
|
||||
pub mod verbosity {
|
||||
pub static QUIET: &str = "quiet";
|
||||
pub static VERBOSE: &str = "verbose";
|
||||
pub const QUIET: &str = "quiet";
|
||||
pub const VERBOSE: &str = "verbose";
|
||||
}
|
||||
pub static BYTES: &str = "bytes";
|
||||
pub static FOLLOW: &str = "follow";
|
||||
pub static LINES: &str = "lines";
|
||||
pub static PID: &str = "pid";
|
||||
pub static SLEEP_INT: &str = "sleep-interval";
|
||||
pub static ZERO_TERM: &str = "zero-terminated";
|
||||
pub static DISABLE_INOTIFY_TERM: &str = "-disable-inotify"; // NOTE: three hyphens is correct
|
||||
pub static USE_POLLING: &str = "use-polling";
|
||||
pub static RETRY: &str = "retry";
|
||||
pub static FOLLOW_RETRY: &str = "F";
|
||||
pub static MAX_UNCHANGED_STATS: &str = "max-unchanged-stats";
|
||||
pub static ARG_FILES: &str = "files";
|
||||
pub static PRESUME_INPUT_PIPE: &str = "-presume-input-pipe"; // NOTE: three hyphens is correct
|
||||
pub const BYTES: &str = "bytes";
|
||||
pub const FOLLOW: &str = "follow";
|
||||
pub const LINES: &str = "lines";
|
||||
pub const PID: &str = "pid";
|
||||
pub const SLEEP_INT: &str = "sleep-interval";
|
||||
pub const ZERO_TERM: &str = "zero-terminated";
|
||||
pub const DISABLE_INOTIFY_TERM: &str = "-disable-inotify"; // NOTE: three hyphens is correct
|
||||
pub const USE_POLLING: &str = "use-polling";
|
||||
pub const RETRY: &str = "retry";
|
||||
pub const FOLLOW_RETRY: &str = "F";
|
||||
pub const MAX_UNCHANGED_STATS: &str = "max-unchanged-stats";
|
||||
pub const ARG_FILES: &str = "files";
|
||||
pub const PRESUME_INPUT_PIPE: &str = "-presume-input-pipe"; // NOTE: three hyphens is correct
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
@ -470,12 +470,11 @@ pub fn parse_args(args: impl uucore::Args) -> UResult<Settings> {
|
|||
|
||||
pub fn uu_app() -> Command {
|
||||
#[cfg(target_os = "linux")]
|
||||
pub static POLLING_HELP: &str = "Disable 'inotify' support and use polling instead";
|
||||
const POLLING_HELP: &str = "Disable 'inotify' support and use polling instead";
|
||||
#[cfg(all(unix, not(target_os = "linux")))]
|
||||
pub static POLLING_HELP: &str = "Disable 'kqueue' support and use polling instead";
|
||||
const POLLING_HELP: &str = "Disable 'kqueue' support and use polling instead";
|
||||
#[cfg(target_os = "windows")]
|
||||
pub static POLLING_HELP: &str =
|
||||
"Disable 'ReadDirectoryChanges' support and use polling instead";
|
||||
const POLLING_HELP: &str = "Disable 'ReadDirectoryChanges' support and use polling instead";
|
||||
|
||||
Command::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
|
|
|
@ -5,20 +5,20 @@
|
|||
|
||||
// spell-checker:ignore (ToDO) kqueue
|
||||
|
||||
pub static DASH: &str = "-";
|
||||
pub static DEV_STDIN: &str = "/dev/stdin";
|
||||
pub static STDIN_HEADER: &str = "standard input";
|
||||
pub static NO_FILES_REMAINING: &str = "no files remaining";
|
||||
pub static NO_SUCH_FILE: &str = "No such file or directory";
|
||||
pub static BECOME_INACCESSIBLE: &str = "has become inaccessible";
|
||||
pub static BAD_FD: &str = "Bad file descriptor";
|
||||
pub const DASH: &str = "-";
|
||||
pub const DEV_STDIN: &str = "/dev/stdin";
|
||||
pub const STDIN_HEADER: &str = "standard input";
|
||||
pub const NO_FILES_REMAINING: &str = "no files remaining";
|
||||
pub const NO_SUCH_FILE: &str = "No such file or directory";
|
||||
pub const BECOME_INACCESSIBLE: &str = "has become inaccessible";
|
||||
pub const BAD_FD: &str = "Bad file descriptor";
|
||||
#[cfg(target_os = "linux")]
|
||||
pub static BACKEND: &str = "inotify";
|
||||
pub const BACKEND: &str = "inotify";
|
||||
#[cfg(all(unix, not(target_os = "linux")))]
|
||||
pub static BACKEND: &str = "kqueue";
|
||||
pub const BACKEND: &str = "kqueue";
|
||||
#[cfg(target_os = "windows")]
|
||||
pub static BACKEND: &str = "ReadDirectoryChanges";
|
||||
pub static FD0: &str = "/dev/fd/0";
|
||||
pub static IS_A_DIRECTORY: &str = "Is a directory";
|
||||
pub static DEV_TTY: &str = "/dev/tty";
|
||||
pub static DEV_PTMX: &str = "/dev/ptmx";
|
||||
pub const BACKEND: &str = "ReadDirectoryChanges";
|
||||
pub const FD0: &str = "/dev/fd/0";
|
||||
pub const IS_A_DIRECTORY: &str = "Is a directory";
|
||||
pub const DEV_TTY: &str = "/dev/tty";
|
||||
pub const DEV_PTMX: &str = "/dev/ptmx";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue