mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 15:20:51 +00:00
feat: add --help for all commands, man pages
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::utils::log::{error, warn};
|
||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, printc};
|
||||
use reqwest::blocking::Client;
|
||||
use serde::Deserialize;
|
||||
use std::fs;
|
||||
@@ -39,6 +40,15 @@ struct ReleaseAsset {
|
||||
}
|
||||
|
||||
pub fn flag_update(args: &[String]) -> i32 {
|
||||
if args.first().map_or(false, |a| a == "--help") {
|
||||
printc("USAGE:", BOLD_GREEN);
|
||||
printc(" dcr --update", BOLD_CYAN);
|
||||
println!();
|
||||
printc("DESCRIPTION:", BOLD_GREEN);
|
||||
println!(" Updates DCR to the latest version from GitHub Releases.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if !args.is_empty() {
|
||||
warn("Command does not support additional arguments");
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user