Skip to content

Commit

Permalink
Change notes with description
Browse files Browse the repository at this point in the history
  • Loading branch information
el7cosmos committed Nov 5, 2020
1 parent c8823c8 commit f87d45c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "talenta"
version = "0.3.1"
version = "0.3.2"
authors = ["el7cosmos <[email protected]>"]
edition = "2018"
description = "Talenta CLI"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ talenta attendance
talenta attendance --date <DATE>

# Non-interactive, use current date
talenta attendance --checkin-time <TIME> --checkout-time <TIME> --reason <reason>
talenta attendance --checkin-time <TIME> --checkout-time <TIME> --description <description>

# Non-interactive, change attendance date
talenta attendance --date <DATE> --checkin-time <TIME> --checkout-time <TIME> --reason <reason>
talenta attendance --date <DATE> --checkin-time <TIME> --checkout-time <TIME> --description <description>
```

#### Independent checkin/checkout
Expand All @@ -63,12 +63,12 @@ talenta attendance checkin --date <DATE> --time <TIME>
talenta attendance checkout --date <DATE> --time <TIME>

# Non-interactive, use current date and time
talenta attendance checkin --reason <reason>
talenta attendance checkout --reason <reason>
talenta attendance checkin --description <description>
talenta attendance checkout --description <description>

# Non-interactive, change attendance date and time
talenta attendance checkin --reason <reason> --date <DATE> --time <TIME>
talenta attendance checkout --reason <reason> --date <DATE> --time <TIME>
talenta attendance checkin --description <description> --date <DATE> --time <TIME>
talenta attendance checkout --description <description> --date <DATE> --time <TIME>
```

- `DATE`: ISO 8601 date format (`YYYY-mm-dd`)
Expand Down
6 changes: 2 additions & 4 deletions src/command/attendance/checkin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ pub(super) struct Checkin {
#[structopt(flatten)]
opts: RootOpts,

#[structopt(short, long)]
#[structopt(name = "description", short, long, visible_aliases = & ["notes", "reason"])]
reason: Option<String>,
#[structopt(
short,
long,
default_value,
help = "Effective date (YYYY-mm-dd)",
value_name = "DATE"
)]
date: Date,
#[structopt(
short,
long,
default_value,
help = "Checkin time (HH:MM)",
Expand All @@ -38,7 +36,7 @@ impl Command for Checkin {

let reason = self.reason.unwrap_or_else(|| {
Input::with_theme(&theme)
.with_prompt("Reason")
.with_prompt("Description")
.interact()
.unwrap()
});
Expand Down
6 changes: 2 additions & 4 deletions src/command/attendance/checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ pub(super) struct Checkout {
#[structopt(flatten)]
opts: RootOpts,

#[structopt(short, long)]
#[structopt(name = "description", short, long, visible_aliases = & ["notes", "reason"])]
reason: Option<String>,
#[structopt(
short,
long,
default_value,
help = "Effective date (YYYY-mm-dd)",
value_name = "DATE"
)]
date: Date,
#[structopt(
short,
long,
default_value,
help = "Checkout time (HH:MM)",
Expand All @@ -38,7 +36,7 @@ impl Command for Checkout {

let reason = self.reason.unwrap_or_else(|| {
Input::with_theme(&theme)
.with_prompt("Reason")
.with_prompt("Description")
.interact()
.unwrap()
});
Expand Down
4 changes: 2 additions & 2 deletions src/command/attendance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) struct Attendance {
#[structopt(flatten)]
opts: RootOpts,

#[structopt(long)]
#[structopt(name = "description", short, long, visible_aliases = & ["notes", "reason"])]
reason: Option<String>,
#[structopt(
default_value,
Expand Down Expand Up @@ -64,7 +64,7 @@ impl Attendance {

let reason = self.reason.unwrap_or_else(|| {
Input::with_theme(&theme)
.with_prompt("Reason")
.with_prompt("Description")
.interact()
.unwrap()
});
Expand Down

0 comments on commit f87d45c

Please sign in to comment.