mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* bin/time, bin/date: use case statement, performance improvement
Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
d2d3ef53cf
commit
079413bb99
2 changed files with 22 additions and 16 deletions
19
bin/date
19
bin/date
|
@ -17,11 +17,14 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if [ "$1" = "--detail" ]; then
|
case "$1" in
|
||||||
date
|
--detail)
|
||||||
exit 0
|
date
|
||||||
elif [ "$1" = "--short" ]; then
|
;;
|
||||||
date +%Y-%m-%d
|
--short)
|
||||||
exit 0
|
date +%Y-%m-%d
|
||||||
fi
|
;;
|
||||||
printf "\005Y-\005m-\005d "
|
*)
|
||||||
|
printf "\005Y-\005m-\005d "
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
19
bin/time
19
bin/time
|
@ -17,12 +17,15 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if [ "$1" = "--detail" ]; then
|
case "$1" in
|
||||||
date
|
--detail)
|
||||||
exit 0
|
date
|
||||||
elif [ "$1" = "--short" ]; then
|
;;
|
||||||
date +%H:%M:%S
|
--short)
|
||||||
exit 0
|
date +%H:%M:%S
|
||||||
fi
|
;;
|
||||||
|
*)
|
||||||
|
printf "\0050c:\005s"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
printf "\0050c:\005s"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue