Skip to content

Commit 369b55a

Browse files
author
Guillaume Petiot
committed
Add the '--version' command-line option
1 parent f7ca29c commit 369b55a

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

Diff for: CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## unreleased
22

3+
### Added
4+
5+
- Add the `--version` command-line option (#<PR_NUMBER>, @gpetiot)
6+
37
### Changed
48

59
- Replace exceptions by result types for the requests (#11, @gpetiot)

Diff for: bin/dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
(name main)
33
(public_name get-activity)
44
(package get-activity)
5-
(libraries cmdliner get-activity-lib))
5+
(libraries cmdliner dune-build-info get-activity-lib))

Diff for: bin/main.ml

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ let period =
6868
in
6969
Term.(const f $ from $ to_ $ last_week)
7070

71-
let info = Cmd.info "get-activity"
71+
let version =
72+
match Build_info.V1.version () with
73+
| None -> "dev"
74+
| Some v -> Build_info.V1.Version.to_string v
75+
76+
let info = Cmd.info "get-activity" ~version
7277

7378
let run period : unit =
7479
match mode with

Diff for: dune-project

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
(synopsis "Collect activity as markdown")
1111
(depends
1212
(cmdliner (>= 1.1.1))
13+
dune-build-info
1314
(get-activity-lib (= :version))))
1415

1516
(package

Diff for: get-activity.opam

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ bug-reports: "https://github.com/tarides/get-activity/issues"
88
depends: [
99
"dune" {>= "2.8"}
1010
"cmdliner" {>= "1.1.1"}
11+
"dune-build-info"
1112
"get-activity-lib" {= version}
1213
"odoc" {with-doc}
1314
]

0 commit comments

Comments
 (0)