Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 41 additions & 20 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
name: Erlang CI

on:
push:
branches:
- openriak-3.2
pull_request:
branches:
- openriak-3.2
on: [push, pull_request]

jobs:

build:

name: Test on ${{ matrix.os }} with OTP ${{ matrix.otp }}
name: OTP-${{ matrix.otp }} Rebar-${{ matrix.rebar }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
otp: [24, 26]
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
otp: ['24', '26', '28']
rebar: ['3.22', '3.24', '3.25']
exclude:
- otp: '24'
os: macos-latest
- otp: '24'
rebar: '3.24'
- otp: '24'
rebar: '3.25'
- otp: '26'
rebar: '3.22'
- otp: '28'
rebar: '3.22'

steps:
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v4
- name: Install Erlang/OTP
uses: erlef/setup-beam@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar }}

- name: Info
run: rebar3 --version

- name: Compile
run: ./rebar3 compile
- name: Run xref and dialyzer
run: ./rebar3 do xref, dialyzer
- name: Run eunit
run: ./rebar3 as gha do eunit
run: rebar3 compile

- name: XRef
run: rebar3 xref

- name: Dialyzer
run: rebar3 dialyzer

- name: EUnit
run: rebar3 eunit

- name: EDoc
run: rebar3 edoc

- name: Example
run: rebar3 as example do compile

- name: Clean
run: rebar3 clean --all
50 changes: 31 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
# rebar
# ===== Common Erlang Tools =====
*.coverdata
*.crashdump
/.cache/
/.eqc*
/.eunit/
/.rebar/
/.rebar3/
/_build/
/_checkouts
/deps
/rebar.lock
*.eqc
*.log
*_plt
.cache/
.eqc
.eqc-info
.erlang.cookie
.erlang.mk
.eunit/
.pulse/
.qc/
.rebar/
.rebar3/
_build/
_checkouts/
_deps/
_test/
ebin/
log/
logs/
rebar.lock

# work environments
# ===== Common Development Tools =====
*.bak
*.dump
*.iml
*.orig
*.plt
*.sublime-project
*.sublime-workspace
*.swo
*.swp
*.tmp
*.txt
*_plt
*~
.concrete/
.DS_Store
.idea/
.project
.settings/
.tm_properties
.vscode/
/*.txt
erln8.config
tmp/

# Erlang build/test artifacts
*.app
*.beam
*.eqc
# ===== Project-specific Elements =====
/doc/
/ebin/
log/
3 changes: 0 additions & 3 deletions Emakefile

This file was deleted.

24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
Getopt for Erlang
=================

[![Build Status][badge]][status]

Command-line parsing module that uses a syntax similar to that of GNU *getopt*.

This is the [OpenRiak][] fork of the [original][upstream] project.

Requirements
------------

You should only need a somewhat recent version of Erlang/OTP. The module has
been tested with all versions of Erlang starting with R13B and ending with 20.
You should only need a somewhat recent version of [Erlang/OTP][otp].
The project currently supports all versions of Erlang since OTP 21.

You also need a recent version of [rebar3][] in the system path.

You also need a recent version of [rebar3](http://www.rebar3.org/) in
the system path.
> _Compatibility with older Erlang releases may be available in the
> [original][upstream] project._

Installation
------------
Expand All @@ -22,14 +27,13 @@ To run the unit tests run `rebar3 eunit`.

To build the (very) limited documentation run `rebar edoc`.

To use getopt in your project you can just add it as a dependency in your
`rebar.config` file in the following way:
To use OpenRiak getopt in your project you can just add it as a dependency
in your `rebar.config` file in the following way:
```erlang
{deps,
[
{getopt, "1.0.2"}
]
}
{deps, [
{getopt, {git, "https://github.com/OpenRiak/getopt.git",
{branch, "openriak-3.2"}}}
]}
```


Expand Down Expand Up @@ -497,3 +501,12 @@ Will return:
```erlang
{ok,{[{path,"/john's files"}],["dummy"]}}
```


[badge]: https://github.com/OpenRiak/getopt/actions/workflows/erlang.yml/badge.svg
[status]: https://github.com/OpenRiak/getopt/actions/workflows/erlang.yml
[openriak]: https://github.com/OpenRiak/
[origin]: https://github.com/OpenRiak/getopt/
[upstream]: https://github.com/jcomellas/getopt/
[otp]: https://www.erlang.org/
[rebar3]: https://www.rebar3.org/
1 change: 0 additions & 1 deletion doc/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion ebin/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion examples/getopt_long_help.escript
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
%%% a copy of the New BSD license with this software. If not, it can be
%%% retrieved from: http://www.opensource.org/licenses/bsd-license.php
%%%-------------------------------------------------------------------
-module(ex1).
-module(getopt_long_help).
-author('[email protected]').

main([]) ->
Expand Down
98 changes: 81 additions & 17 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,23 +1,87 @@
{erl_opts, [warn_unused_vars,
warn_export_all,
warn_shadow_vars,
warn_unused_import,
warn_unused_function,
%% -*- mode: erlang; erlang-indent-level: 4; indent-tabs-mode: nil -*-

{minimum_otp_vsn, "21"}.

{erl_opts, [
debug_info,
warn_bif_clash,
warn_deprecated_function,
warn_deprecated_type,
warn_export_all,
warn_export_vars,
warn_missing_spec,
warn_obsolete_guard,
warn_shadow_vars,
warn_untyped_record,
warn_unused_function,
warn_unused_import,
warn_unused_record,
warn_unused_vars,
warnings_as_errors
]}.

{cover_enabled, true}.

{dialyzer, [
{warnings, [
error_handling,
unknown,
unmatched_returns
]}
]}.

{xref_checks, [
deprecated_function_calls,
deprecated_functions,
locals_not_used,
undefined_function_calls,
undefined_functions
]}.

{profiles, [
{docs, [
{edoc_opts, [
{preprocess, true},
{macros, [{'EDOC', true}]}
]}
]},
{example, [
{erl_opts, [
nowarn_missing_spec
]},
{extra_src_dirs, [
"examples"
]}
]},
{test, [
{erl_opts, [
nowarn_missing_spec
]}
]},
{validate, [
{erl_opts, [
strong_validation,
no_auto_import,
warn_bif_clash,
warn_unused_record,
warn_deprecated_function,
warn_obsolete_guard,
strict_validation,
warn_deprecated_type,
warn_export_all,
warn_export_vars,
warn_exported_vars,
warn_missing_spec,
warn_untyped_record, debug_info,
{platform_define, "^2", unicode_str}
warn_missing_spec_all,
warn_obsolete_guard,
warn_shadow_vars,
warn_untyped_record,
warn_unused_function,
warn_unused_import,
warn_unused_record,
warn_unused_vars,
{d, 'VALIDATE'}
]}
]}
]}.

{dialyzer, [{plt_apps, all_deps}]}.

{profiles, [{gha, [{erl_opts, [{d, 'GITHUBEXCLUDE'}]}]}]}.

{xref_checks,[undefined_function_calls,undefined_functions,locals_not_used,
deprecated_function_calls, deprecated_functions]}.
{alias, [
{check, [xref, dialyzer]},
{test, [eunit, cover]}
]}.
Binary file removed rebar3
Binary file not shown.
26 changes: 17 additions & 9 deletions src/getopt.app.src
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
{application,getopt,
[{description,"Command-line options parser for Erlang"},
{vsn,"1.0.2"},
{modules,[]},
{registered,[]},
{maintainers,["Juan Jose Comellas"]},
{licenses,["BSD"]},
{links,[{"GitHub","https://github.com/jcomellas/getopt"}]},
{applications,[kernel,stdlib]}]}.
%% -*- mode: erlang; erlang-indent-level: 4; indent-tabs-mode: nil -*-
{application, getopt, [
{description, "Command-line options parser for Erlang"},
{vsn, "1.0.3.1"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib]},
{maintainers, [
"The OpenRiak Project",
"Juan Jose Comellas"
]},
{licenses, ["BSD"]},
{links, [
{"GitHub", "https://github.com/OpenRiak/getopt"},
{"GitHub", "https://github.com/jcomellas/getopt"}
]}
]}.
Loading
Loading