Skip to content

Commit

Permalink
Issue #391: unknown command "chargeonce"
Browse files Browse the repository at this point in the history
Reference:
* #391
  • Loading branch information
linrunner committed Mar 15, 2019
1 parent e3352ab commit b9ec241
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions func.d/35-tlp-func-batt
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,8 @@ chargeonce_battery () { # charge battery to upper threshold once
case $_bm_read in
natacpi|tpacpi) # use ACPI sysfiles
if [ -f $_bd_read/energy_full ]; then
read_sysval $_bd_read/energy_full; efull=$?
read_sysval $_bd_read/energy_now; enow=$?
efull=$(read_sysval $_bd_read/energy_full)
enow=$(read_sysval $_bd_read/energy_now)
fi

if [ $efull -ne 0 ]; then
Expand All @@ -703,7 +703,7 @@ chargeonce_battery () { # charge battery to upper threshold once
;; # natacpi, tpacpi

tpsmapi) # use tp-smapi sysfiles
read_sysval $_bd_read/remaining_percent; ccharge=$?
ccharge=$(read_sysval $_bd_read/remaining_percent)
;; # tpsmapi

*) # invalid read method
Expand Down
2 changes: 1 addition & 1 deletion tlp-func-base.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# ----------------------------------------------------------------------------
# Constants

readonly TLPVER="1.2"
readonly TLPVER="1.2.1"

readonly CONFFILE=@TLP_CONF@
readonly RUNDIR=@TLP_RUN@
Expand Down
4 changes: 2 additions & 2 deletions tlp.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ apply_common_settings () { # apply settings common to all modes
}

show_usage () {
echo "Usage: tlp start|true|bat|false|ac|usb|bayoff|discharge|setcharge|fullcharge|recalibrate|diskid" 1>&2
echo "Usage: tlp start|true|bat|false|ac|usb|bayoff|chargeonce|discharge|setcharge|fullcharge|recalibrate|diskid" 1>&2
}

parse_args () { # parse command-line arguments
Expand Down Expand Up @@ -85,7 +85,7 @@ parse_args () { # parse command-line arguments
_carg3=""
;;

discharge|fullcharge|recalibrate)
chargeonce|discharge|fullcharge|recalibrate)
# commands with one or no arguments
_cmd="$1"
_cmd2=""
Expand Down

0 comments on commit b9ec241

Please sign in to comment.