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
15
bin/date
15
bin/date
|
@ -17,11 +17,14 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if [ "$1" = "--detail" ]; then
|
||||
case "$1" in
|
||||
--detail)
|
||||
date
|
||||
exit 0
|
||||
elif [ "$1" = "--short" ]; then
|
||||
;;
|
||||
--short)
|
||||
date +%Y-%m-%d
|
||||
exit 0
|
||||
fi
|
||||
printf "\005Y-\005m-\005d "
|
||||
;;
|
||||
*)
|
||||
printf "\005Y-\005m-\005d "
|
||||
;;
|
||||
esac
|
||||
|
|
15
bin/time
15
bin/time
|
@ -17,12 +17,15 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if [ "$1" = "--detail" ]; then
|
||||
case "$1" in
|
||||
--detail)
|
||||
date
|
||||
exit 0
|
||||
elif [ "$1" = "--short" ]; then
|
||||
;;
|
||||
--short)
|
||||
date +%H:%M:%S
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf "\0050c:\005s"
|
||||
;;
|
||||
esac
|
||||
|
||||
printf "\0050c:\005s"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue