1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::path::PathBuf;
use abscissa_core::{error::BoxError, EntryPoint, Options};
use crate::commands::CliCmd;
pub use ibc_relayer::config::Config;
pub fn config_path() -> Result<PathBuf, BoxError> {
let mut args = std::env::args();
assert!(args.next().is_some(), "expected one argument but got zero");
let args = args.collect::<Vec<_>>();
let app = EntryPoint::<CliCmd>::parse_args_default(args.as_slice())?;
let config_path = app.config.ok_or("no config file specified")?;
Ok(config_path)
}