# Using CLI arguments through modules and configuration files

**URL:** <https://discuss.ocaml.org/t/using-cli-arguments-through-modules-and-configuration-files/6725>\
**Category:** Learning\
**Created:** [November 8, 2020, 2:33pm UTC](https://discuss.ocaml.org/t/using-cli-arguments-through-modules-and-configuration-files/6725 "2020-11-08T14:33:20Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![erhan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/erhan/32/1919_2.png) [@erhan](https://discuss.ocaml.org/u/erhan)\
**Post date:** [November 8, 2020, 2:33pm UTC](https://discuss.ocaml.org/t/using-cli-arguments-through-modules-and-configuration-files/6725/1 "2020-11-08T14:33:20Z")

</div>

Hello everyone.

I was looking for common approaches and best practises regarding to CLI argument passing and configuration files. I couldn’t find much after googling so here is my questions:

1. I am getting arguments with cmdliner library and passing those arguments through functions. And sometimes I have to pass these arguments through multiple functions. I am not sure if that’s the correct way of doing it. Let’s say I have `verbose` flag defined and I have logs in various modules. So how can I receive this flag whenever needed? Could you please share any resources regarding to saving arguments and accessing them from different modules?

2. Is there a configuration file concept in OCaml? Files such as `.yaml` and `.json`

---

_[View the full topic](https://discuss.ocaml.org/t/using-cli-arguments-through-modules-and-configuration-files/6725)._
