1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// jja: swiss army knife for chess file formats
// src/reexec.rs: Reexecuting Self for fun and profit
//
// Copyright (c) 2023 Ali Polatel <alip@chesswob.org>
//
// SPDX-License-Identifier: GPL-3.0-or-later
use ;
use escape;
/// Creates a closure that returns a `Command` which re-executes the current
/// executable with the provided arguments.
///
/// This function takes a slice of `&str` representing the command line
/// arguments to pass to the re-executed program. The command with properly
/// quoted and escaped arguments will be printed to stderr before the closure
/// is returned.
///
/// # Arguments
///
/// * `args` - A slice of string references representing the command line
/// arguments to pass to the re-executed program.
///
/// # Returns
///
/// A boxed closure that, when called, returns a `Command` configured to
/// re-execute the current executable with the provided arguments.