diff options
Diffstat (limited to 'src/federation/party.rs')
| -rw-r--r-- | src/federation/party.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/federation/party.rs b/src/federation/party.rs index eaf28b5..17e3f0e 100644 --- a/src/federation/party.rs +++ b/src/federation/party.rs @@ -627,7 +627,13 @@ fn begin_federation(dir: &Path, matches: &ArgMatches) -> Result<()> { /// Runs the client, as its arguments say. pub(crate) async fn main() -> Result<()> { - let matches = command().get_matches(); + // The importers it names, off the command line first: their names are its own. + let mut arguments = std::env::args(); + let program = arguments + .next() + .unwrap_or_else(|| "continuum-party".to_owned()); + let (arguments, named) = ::config::arguments::take_importers(arguments)?; + let matches = command().get_matches_from(std::iter::once(program).chain(arguments)); let (name, sub) = matches.subcommand().expect("a subcommand is required"); // Those that use no options read no federation's. let dir = if matches!(name, "twice" | "root" | "judge" | "found") { @@ -651,7 +657,7 @@ pub(crate) async fn main() -> Result<()> { .map(|dir| dir.join("party.toml")) .filter(|file| file.exists()) .collect(); - let (merged, _) = config::merged(&matches, &config::PARTY, &first)?; + let (merged, _) = ::config::arguments::merged_in(&matches, &config::PARTY, &first, &named)?; let mut options: Options = config::read(&merged)?; // In a federation's directory, its record and key, where none other is named. if let Some(dir) = &dir { |
