Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add size unit options to commands #434

Merged
merged 7 commits into from
Nov 11, 2022
Merged

Add size unit options to commands #434

merged 7 commits into from
Nov 11, 2022

Conversation

vinc
Copy link
Owner

@vinc vinc commented Nov 6, 2022

  • Add list --binary-size (aliased to l -b)
  • Add disk usage --binary-size (aliased to dsk u -b)
  • Add memory usage --binary-size (aliased to mem u -b)
  • Align sizes to the right

@vinc
Copy link
Owner Author

vinc commented Nov 6, 2022

Before:

> memory usage
size: 134193152
used: 52184
free: 134140968

After:

> memory usage
size: 134193152
used:     52184
free: 134140968

> memory usage --binary-size
size: 128M
used:  51K
free: 128M

@vinc
Copy link
Owner Author

vinc commented Nov 6, 2022

Before

> list /tmp
5090 2022-11-01 12:53:47 alice.txt
82   2022-11-01 12:53:48 beep
324  2022-11-01 12:53:48 life
111  2022-11-01 12:53:47 lisp
649  2022-11-01 12:53:47 machines.txt

> list /bin
1000  2022-11-03 19:40:58 clear
1184  2022-11-03 19:40:58 halt
30704 2022-11-03 19:40:59 hello
1128  2022-11-03 19:40:59 print
1184  2022-11-03 19:40:59 reboot
24616 2022-11-03 19:41:00 sleep

After:

> list /tmp
5090 2022-11-01 12:53:47 alice.txt
  82 2022-11-01 12:53:48 beep
 324 2022-11-01 12:53:48 life
 111 2022-11-01 12:53:47 lisp
 649 2022-11-01 12:53:47 machines.txt

> list /bin
 1000 2022-11-03 19:40:58 clear
 1184 2022-11-03 19:40:58 halt
30704 2022-11-03 19:40:59 hello
 1128 2022-11-03 19:40:59 print
 1184 2022-11-03 19:40:59 reboot
24616 2022-11-03 19:41:00 sleep

> list /tmp --binary-size
4.9K 2022-11-01 12:53:47 alice.txt
  82 2022-11-01 12:53:48 beep
 324 2022-11-01 12:53:48 life
 111 2022-11-01 12:53:47 lisp
 649 2022-11-01 12:53:47 machines.txt

> list /bin --binary-size
1000 2022-11-03 19:40:58 clear
1.1K 2022-11-03 19:40:58 halt
 30K 2022-11-03 19:40:59 hello
1.1K 2022-11-03 19:40:59 print
1.1K 2022-11-03 19:40:59 reboot
 24K 2022-11-03 19:41:00 sleep

@vinc vinc marked this pull request as ready for review November 11, 2022 09:41
@vinc vinc merged commit b51b060 into trunk Nov 11, 2022
@vinc vinc deleted the feature/size-unit branch November 11, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant