Add more help information.

This commit is contained in:
Nicolás A. Ortega Froysa 2022-07-19 22:56:37 +02:00
parent b5781619db
commit 20172f5f27
2 changed files with 17 additions and 17 deletions

View File

@ -142,7 +142,7 @@ impl HabitMgr
self.export_habits();
}
pub fn list(&mut self, _all:bool, _verbose:bool)
pub fn list(&mut self, _all:bool)
{
self.import_habits();
if self.habits.is_empty()

View File

@ -42,13 +42,15 @@ enum Command
#[structopt(alias = "a")]
Add
{
#[structopt(help = "name of the new habit")]
#[structopt(help = "Name of the new habit")]
name:String,
#[structopt(long, short, default_value = "mon,tue,wed,thu,fri,sat,sun")]
#[structopt(long, short, help = "Days the new habit is active",
default_value = "mon,tue,wed,thu,fri,sat,sun")]
days:String,
#[structopt(long)]
#[structopt(long, help = "Assign habit as a bad habit (negative points)")]
bad:bool,
#[structopt(short, long, default_value = "5")]
#[structopt(short, long, help = "Weight/priority of the new habit",
default_value = "5")]
weight:u8,
},
Commit { },
@ -59,31 +61,29 @@ enum Command
},
#[structopt(alias = "i")]
Info {
#[structopt(help = "ID of the habit to show information for")]
id:usize,
},
#[structopt(alias = "ls")]
List
{
#[structopt(short, long, help = "list all active habits")]
#[structopt(short, long, help = "List all active habits")]
all:bool,
#[structopt(short, long, help = "show UUIDs")]
verbose:bool,
},
#[structopt(alias = "mod")]
Modify {
#[structopt(help = "ID of the habit to modify")]
id:usize,
#[structopt(short, long)]
#[structopt(short, long, help = "New name for the habit")]
name:Option<String>,
#[structopt(short, long)]
#[structopt(short, long, help = "New weight of the habit")]
weight:Option<u8>,
#[structopt(long, short)]
#[structopt(long, short, help = "New days the habit is active")]
days:Option<String>,
#[structopt(long)]
#[structopt(long, help = "Toggle the 'bad' value of the habit")]
toggle_bad:bool,
},
#[structopt(alias = "stats")]
Statistics { },
Stats { },
}
fn main()
@ -112,7 +112,7 @@ fn main()
match opts.cmd
{
None => hmgr.list(false, false),
None => hmgr.list(false),
Some(c) =>
match c
{
@ -122,8 +122,8 @@ fn main()
hmgr.delete(id),
Command::Info { id } =>
hmgr.habit_info(id),
Command::List { all, verbose } =>
hmgr.list(all, verbose),
Command::List { all } =>
hmgr.list(all),
Command::Modify { id, name, weight, days, toggle_bad } =>
hmgr.modify(id, name, toggle_bad, weight, days),
_ => todo!(),