Skip to content

Commit f9a7652

Browse files
Copilotjosecelano
andcommitted
fix: update doctests to include working_dir parameter
- Add working_dir field to GlobalArgs doctest example - Update execute() doctest to pass working_dir parameter Co-authored-by: josecelano <[email protected]>
1 parent 7fd0c2b commit f9a7652

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/presentation/cli/args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ impl GlobalArgs {
9595
/// log_stderr_format: LogFormat::Pretty,
9696
/// log_output: LogOutput::FileAndStderr,
9797
/// log_dir: PathBuf::from("/tmp/logs"),
98+
/// working_dir: PathBuf::from("."),
9899
/// };
99100
/// let config = args.logging_config();
100101
/// // config will have specified log formats and directory

src/presentation/commands/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ pub mod destroy;
4040
/// ```rust
4141
/// use clap::Parser;
4242
/// use torrust_tracker_deployer_lib::presentation::{cli, commands};
43+
/// use std::path::Path;
4344
///
4445
/// let cli = cli::Cli::parse();
4546
/// if let Some(command) = cli.command {
46-
/// let result = commands::execute(command);
47+
/// let working_dir = Path::new(".");
48+
/// let result = commands::execute(command, working_dir);
4749
/// match result {
4850
/// Ok(_) => println!("Command executed successfully"),
4951
/// Err(e) => commands::handle_error(&e),

0 commit comments

Comments
 (0)