Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
root.hh
1
#pragma once
2
3
#include "
nix/util/args.hh
"
4
5
namespace
nix {
6
13
struct
Completions
final :
AddCompletions
14
{
15
std::set<Completion> completions;
16
Type
type = Type::Normal;
17
18
void
setType
(
Type
type)
override
;
19
void
add
(std::string completion, std::string description =
""
)
override
;
20
};
21
30
class
RootArgs
:
virtual
public
Args
31
{
32
protected
:
41
std::filesystem::path
commandBaseDir
=
"."
;
42
43
public
:
47
void
parseCmdline
(
const
Strings & cmdline,
bool
allowShebang =
false
);
48
49
std::shared_ptr<Completions> completions;
50
51
std::filesystem::path
getCommandBaseDir
()
const override
;
52
53
protected
:
54
55
friend
class
Args;
56
60
struct
DeferredCompletion
61
{
62
const
CompleterClosure
& completer;
63
size_t
n;
64
std::string prefix;
65
};
66
71
std::vector<DeferredCompletion>
deferredCompletions
;
72
79
std::set<ExperimentalFeature>
flagExperimentalFeatures
;
80
81
private
:
82
83
std::optional<std::string> needsCompletion(std::string_view s);
84
};
85
86
}
// namespace nix
args.hh
nix::AddCompletions
Definition
args.hh:466
nix::AddCompletions::Type
Type
Definition
args.hh:475
nix::Args::CompleterClosure
std::function< CompleterFun > CompleterClosure
Definition
args.hh:186
nix::RootArgs
Definition
root.hh:31
nix::RootArgs::commandBaseDir
std::filesystem::path commandBaseDir
The command's "working directory", but only set when top level.
Definition
root.hh:41
nix::RootArgs::deferredCompletions
std::vector< DeferredCompletion > deferredCompletions
Definition
root.hh:71
nix::RootArgs::parseCmdline
void parseCmdline(const Strings &cmdline, bool allowShebang=false)
Definition
args.cc:270
nix::RootArgs::getCommandBaseDir
std::filesystem::path getCommandBaseDir() const override
Get the base directory for the command.
Definition
args.cc:383
nix::RootArgs::flagExperimentalFeatures
std::set< ExperimentalFeature > flagExperimentalFeatures
Definition
root.hh:79
nix::Completions
Definition
root.hh:14
nix::Completions::add
void add(std::string completion, std::string description="") override
Definition
args.cc:48
nix::Completions::setType
void setType(Type type) override
Definition
args.cc:43
nix::RootArgs::DeferredCompletion
Definition
root.hh:61
libutil
include
nix
util
args
root.hh
Generated by
1.18.0