dmesg: add about and usage to command.

This commit is contained in:
Fuad Ismail
2024-11-17 00:09:55 +07:00
parent 635c6955c3
commit 395c634c0c
2 changed files with 13 additions and 1 deletions

7
src/uu/dmesg/dmesg.md Normal file
View File

@@ -0,0 +1,7 @@
# dmesg
```
dmesg [options]
```
Display or control the kernel ring buffer.

View File

@@ -6,10 +6,13 @@
use clap::{crate_version, Arg, ArgAction, Command};
use regex::Regex;
use std::fs;
use uucore::error::UResult;
use uucore::{error::UResult, format_usage, help_about, help_usage};
mod json;
const ABOUT: &str = help_about!("dmesg.md");
const USAGE: &str = help_usage!("dmesg.md");
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let mut dmesg = Dmesg::new();
@@ -26,6 +29,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.override_usage(format_usage(USAGE))
.about(ABOUT)
.version(crate_version!())
.arg(
Arg::new(options::KMSG_FILE)