Skip to content

Commit

Permalink
Updated argparse to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
max-au committed Apr 13, 2024
1 parent dbc7cff commit 3e787ee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.2.1
- tested with OTP 26 and 27
- updated to argparse 2.0.0

## 2.2.0
- added extended and full reporting capabilities
- implemented additional statistics (standard deviation, median, p99)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,16 @@ on disk.
Use `-pa` argument to add an extra code path. Example:
```bash
$ ./erlperf 'argparse:parse([], #{}).' -pa _build/test/lib/argparse/ebin
$ ./erlperf 'args:parse([], #{}).' -pa _build/test/lib/argparse/ebin
Code || QPS Time
argparse:parse([], #{}). 1 955 Ki 1047 ns
args:parse([], #{}). 1 955 Ki 1047 ns
```
If you need to add multiple released applications, supply `ERL_LIBS` environment variable instead:
```bash
$ ERL_LIBS="_build/test/lib" erlperf 'argparse:parse([], #{}).'
$ ERL_LIBS="_build/test/lib" erlperf 'args:parse([], #{}).'
Code || QPS Time
argparse:parse([], #{}). 1 735 Ki 1361 ns
args:parse([], #{}). 1 735 Ki 1361 ns
```
### Usage in production
Expand Down
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{"1.2.0",
[{<<"argparse">>,{pkg,<<"argparse">>,<<"1.2.4">>},0}]}.
[{<<"argparse">>,{pkg,<<"argparse">>,<<"2.0.0">>},0}]}.
[
{pkg_hash,[
{<<"argparse">>, <<"A31E7C5D9F8814AFCD9B42C1B98C21DA6F851F93F2C8C00C107F6201668A0A7D">>}]},
{<<"argparse">>, <<"3EDF299FB5BC089E6AF2F1A7C6532104B4CD6136E0147C6CF9622E6E4A741434">>}]},
{pkg_hash_ext,[
{<<"argparse">>, <<"AC6FDB7183EA20ADEB7EB66E34B21F2E8C4C6925913EE0C0765D339D97009FFE">>}]}
{<<"argparse">>, <<"525979122BEA3641A1DD3ABC53F2ADD19F7F427D507018F8C7CAF0693A6E78C8">>}]}
].
2 changes: 1 addition & 1 deletion src/erlperf.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, erlperf,
[{description, "Erlang Performance & Benchmarking Suite"},
{vsn, "2.2.0"},
{vsn, "2.2.1"},
{registered, [
erlperf_sup, erlperf_job_sup, erlperf_monitor,
erlperf_history, erlperf_file_log, erlperf_cluster_monitor
Expand Down
6 changes: 3 additions & 3 deletions src/erlperf_cli.erl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ format(Reports, Options) ->
main(Args) ->
Prog = #{progname => "erlperf"},
try
ParsedOpts = argparse:parse(Args, arguments(), Prog),
ParsedOpts = args:parse(Args, arguments(), Prog),

Verbose = maps:get(verbose, ParsedOpts, false),

Expand Down Expand Up @@ -149,8 +149,8 @@ main(Args) ->
Formatted = format(Results, FormatOpts#{viewport_width => viewport_width()}),
io:format(Formatted)
catch
error:{argparse, Reason} ->
Fmt = argparse:format_error(Reason, arguments(), Prog),
error:{args, Reason} ->
Fmt = args:format_error(Reason, arguments(), Prog),
format(info, "Error: ~s", [Fmt]);
throw:{parse, FunName, Other} ->
format(error, "Unable to read file named '~s' (expected to contain call chain recording)~nReason: ~p\n"
Expand Down

0 comments on commit 3e787ee

Please sign in to comment.