Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the '--version' command-line option #13

Merged
merged 2 commits into from
Mar 8, 2024
Merged
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
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
Loading