File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,13 @@ Given a version number MAJOR.MINOR.PATCH:
1414- MINOR version when adding functionality in a backwards compatible manner,
1515- PATCH version when making backwards compatible bug fixes.
1616
17- ## [ 0.5.0] - 2021-09-03
17+ ## [ 0.5.1] - 2021-09-08
18+
19+ ## Changed
20+
21+ - cpu_info.sh: use bash function for command usage information
22+
23+ ## [ 0.5.0] - 2021-09-08
1824
1925## Added
2026
Original file line number Diff line number Diff line change 66# Also : https://apple.stackexchange.com/questions/238777/how-do-i-identify-which-cpu-a-macbook-uses/238789#238789
77# Interesting output with `system_profiler SPHardwareDataType | grep Processor`
88
9+ usage () {
10+ echo " Usage information: ./cpu_info.sh [--short | --all | --help]"
11+ echo " - short: print CPU Brand/Model, Core count, Thread count"
12+ echo " - all: print all cpu information"
13+ }
14+
915if [ -z " $1 " ]; then
1016 sysctl -n machdep.cpu.brand_string
1117 sysctl -a | grep machdep.cpu.core_count | sed ' s/machdep.//'
@@ -17,11 +23,7 @@ elif [ "$1" = "--short" ]; then
1723 sysctl -a | grep machdep.cpu.core_count | sed ' s/machdep.//'
1824 sysctl -a | grep machdep.cpu.thread_count | sed ' s/machdep.//'
1925elif [ " $1 " = " --help" ]; then
20- echo " Usage information: ./cpu_info.sh [short|all]"
21- echo " - short: print CPU Brand/Model, Core count, Thread count"
22- echo " - all: print all cpu information"
26+ usage
2327else
24- echo " Usage information: ./cpu_info.sh [short|all]"
25- echo " - short: print CPU Brand/Model, Core count, Thread count"
26- echo " - all: print all cpu information"
28+ usage
2729fi
You can’t perform that action at this time.
0 commit comments