Skip to content

Commit

Permalink
Add the '--version' command-line option (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetiot authored Mar 8, 2024
1 parent f7ca29c commit 06b13cf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## unreleased

### Added

- Add the `--version` command-line option (#13, @gpetiot)

### Changed

- Replace exceptions by result types for the requests (#11, @gpetiot)
Expand Down
2 changes: 1 addition & 1 deletion bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
(name main)
(public_name get-activity)
(package get-activity)
(libraries cmdliner get-activity-lib))
(libraries cmdliner dune-build-info get-activity-lib))
7 changes: 6 additions & 1 deletion bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ let period =
in
Term.(const f $ from $ to_ $ last_week)

let info = Cmd.info "get-activity"
let version =
match Build_info.V1.version () with
| None -> "dev"
| Some v -> Build_info.V1.Version.to_string v

let info = Cmd.info "get-activity" ~version

let run period : unit =
match mode with
Expand Down
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
(synopsis "Collect activity as markdown")
(depends
(cmdliner (>= 1.1.1))
dune-build-info
(get-activity-lib (= :version))))

(package
Expand Down
1 change: 1 addition & 0 deletions get-activity.opam
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ bug-reports: "https://github.com/tarides/get-activity/issues"
depends: [
"dune" {>= "2.8"}
"cmdliner" {>= "1.1.1"}
"dune-build-info"
"get-activity-lib" {= version}
"odoc" {with-doc}
]
Expand Down

0 comments on commit 06b13cf

Please sign in to comment.