File size: 1,524 Bytes
2492322
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright (c) 2019, QuantStack and Mamba Contributors
//
// Distributed under the terms of the BSD 3-Clause License.
//
// The full license is in the file LICENSE, distributed with this software.

#pragma once

#include <string>
#include <vector>

#include "mamba/fs/filesystem.hpp"

// TODO move these structures back to Context.hpp or rename this file
// with a better name when the Context is fully refactored.
namespace mamba
{
    struct CommandParams
    {
        std::string caller_version{ "" };
        std::string conda_version{ "3.8.0" };
        std::string current_command{ "mamba" };
        /** Is the Context used in a mamba or mamba executable (instead of a lib). */
        bool is_mamba_exe{ false };
    };

    struct PrefixParams
    {
        fs::u8path target_prefix;
        fs::u8path root_prefix;
        fs::u8path conda_prefix;
        fs::u8path relocate_prefix;
    };

    struct LinkParams
    {
        bool allow_softlinks = false;
        bool always_copy = false;
        bool always_softlink = false;
        bool compile_pyc = true;
    };

    struct ThreadsParams
    {
        std::size_t download_threads{ 5 };
        int extract_threads{ 0 };
    };

    struct TransactionParams
    {
        bool is_mamba_exe;
        bool json_output;
        int verbosity;
        bool shortcuts;
        std::vector<fs::u8path> envs_dirs;
        std::string platform;

        PrefixParams prefix_params;
        LinkParams link_params;
        ThreadsParams threads_params;
    };
}