mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +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:
@@ -43,18 +43,21 @@ pub fn wifi<C: Context>() -> ParentHandler<C> {
|
||||
"add",
|
||||
from_fn_async(add)
|
||||
.no_display()
|
||||
.with_about("Add wifi ssid and password")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand(
|
||||
"connect",
|
||||
from_fn_async(connect)
|
||||
.no_display()
|
||||
.with_about("Connect to wifi network")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand(
|
||||
"delete",
|
||||
from_fn_async(delete)
|
||||
.no_display()
|
||||
.with_about("Remove a wifi network")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand(
|
||||
@@ -64,10 +67,17 @@ pub fn wifi<C: Context>() -> ParentHandler<C> {
|
||||
.with_custom_display_fn(|handle, result| {
|
||||
Ok(display_wifi_info(handle.params, result))
|
||||
})
|
||||
.with_about("List wifi info")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand("country", country::<C>())
|
||||
.subcommand("available", available::<C>())
|
||||
.subcommand(
|
||||
"country",
|
||||
country::<C>().with_about("Command to set country"),
|
||||
)
|
||||
.subcommand(
|
||||
"available",
|
||||
available::<C>().with_about("Command to list available wifi networks"),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn available<C: Context>() -> ParentHandler<C> {
|
||||
@@ -76,6 +86,7 @@ pub fn available<C: Context>() -> ParentHandler<C> {
|
||||
from_fn_async(get_available)
|
||||
.with_display_serializable()
|
||||
.with_custom_display_fn(|handle, result| Ok(display_wifi_list(handle.params, result)))
|
||||
.with_about("List available wifi networks")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
}
|
||||
@@ -85,6 +96,7 @@ pub fn country<C: Context>() -> ParentHandler<C> {
|
||||
"set",
|
||||
from_fn_async(set_country)
|
||||
.no_display()
|
||||
.with_about("Set Country")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user