mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 06:19:44 +00:00
add with_about for CLI commands (#2741)
* add with_about for echo, server, and auth * update for feedback * finish (most) remaining command documentation * update comments after additional clarification * add expanded_api descriptions * add comments for action_api * add comments for remaining apis * add comment for package-rebuild * fix build errors * missed one with_about * add context to git-info subcommands * remove context from git-info subcommands * Make git-info from_fns generic over context * make version::git_info generic over the context * try removing generics from subcommand and version::git_info * try adding a closure with context * Updates for reviewer feedback
This commit is contained in:
@@ -13,31 +13,48 @@ use crate::Error;
|
||||
|
||||
pub fn diagnostic<C: Context>() -> ParentHandler<C> {
|
||||
ParentHandler::new()
|
||||
.subcommand("error", from_fn(error).with_call_remote::<CliContext>())
|
||||
.subcommand("logs", crate::system::logs::<DiagnosticContext>())
|
||||
.subcommand(
|
||||
"error",
|
||||
from_fn(error)
|
||||
.with_about("Display diagnostic error")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand(
|
||||
"logs",
|
||||
from_fn_async(crate::logs::cli_logs::<DiagnosticContext, Empty>).no_display(),
|
||||
crate::system::logs::<DiagnosticContext>().with_about("Display OS logs"),
|
||||
)
|
||||
.subcommand(
|
||||
"logs",
|
||||
from_fn_async(crate::logs::cli_logs::<DiagnosticContext, Empty>)
|
||||
.no_display()
|
||||
.with_about("Display OS logs"),
|
||||
)
|
||||
.subcommand(
|
||||
"kernel-logs",
|
||||
crate::system::kernel_logs::<DiagnosticContext>(),
|
||||
crate::system::kernel_logs::<DiagnosticContext>().with_about("Display kernel logs"),
|
||||
)
|
||||
.subcommand(
|
||||
"kernel-logs",
|
||||
from_fn_async(crate::logs::cli_logs::<DiagnosticContext, Empty>).no_display(),
|
||||
from_fn_async(crate::logs::cli_logs::<DiagnosticContext, Empty>)
|
||||
.no_display()
|
||||
.with_about("Display kernal logs"),
|
||||
)
|
||||
.subcommand(
|
||||
"restart",
|
||||
from_fn(restart)
|
||||
.no_display()
|
||||
.with_about("Restart the server")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand("disk", disk::<C>())
|
||||
.subcommand(
|
||||
"disk",
|
||||
disk::<C>().with_about("Command to remove disk from filesystem"),
|
||||
)
|
||||
.subcommand(
|
||||
"rebuild",
|
||||
from_fn_async(rebuild)
|
||||
.no_display()
|
||||
.with_about("Teardown and rebuild service containers")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
}
|
||||
@@ -72,7 +89,8 @@ pub fn disk<C: Context>() -> ParentHandler<C> {
|
||||
CallRemoteHandler::<CliContext, _, _>::new(
|
||||
from_fn_async(forget_disk::<RpcContext>).no_display(),
|
||||
)
|
||||
.no_display(),
|
||||
.no_display()
|
||||
.with_about("Remove disk from filesystem"),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user