Skip to content

Commit

Permalink
Start arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Nov 27, 2021
1 parent a126191 commit fe309e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v0.2.0 - 2021-11-23

- Converted from rebar3 to the Gleam build tool.
- The `erlang` module gains the `start_arguments` function.

## v0.1.0 - 2021-09-11

Expand Down
11 changes: 11 additions & 0 deletions src/gleam/erlang.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,14 @@ pub type Crash {
Thrown(Dynamic)
Errored(Dynamic)
}

external fn get_start_arguments() -> List(Charlist) =
"init" "get_plain_arguments"

/// Get the arguments given to the program when it was started.
///
/// This is sometimes called `argv` in other languages.
pub fn start_arguments() -> List(String) {
get_start_arguments()
|> list.map(charlist.to_string)
}

0 comments on commit fe309e3

Please sign in to comment.