Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
root.hh
1#pragma once
2
3#include "args.hh"
4
5namespace nix {
6
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
30class RootArgs : virtual public Args
31{
32protected:
42
43public:
47 void parseCmdline(const Strings & cmdline, bool allowShebang = false);
48
49 std::shared_ptr<Completions> completions;
50
51 Path getCommandBaseDir() const override;
52
53protected:
54
55 friend class Args;
56
61 const CompleterClosure & completer;
62 size_t n;
63 std::string prefix;
64 };
65
70 std::vector<DeferredCompletion> deferredCompletions;
71
78 std::set<ExperimentalFeature> flagExperimentalFeatures;
79
80private:
81
82 std::optional<std::string> needsCompletion(std::string_view s);
83};
84
85}
Definition args.hh:419
Type
Definition args.hh:425
std::function< CompleterFun > CompleterClosure
Definition args.hh:167
Definition root.hh:31
Path commandBaseDir
The command's "working directory", but only set when top level.
Definition root.hh:41
std::vector< DeferredCompletion > deferredCompletions
Definition root.hh:70
void parseCmdline(const Strings &cmdline, bool allowShebang=false)
Definition args.cc:252
Path getCommandBaseDir() const override
Get the base directory for the command.
Definition args.cc:361
std::set< ExperimentalFeature > flagExperimentalFeatures
Definition root.hh:78
return s
Definition lexer.l:459
Definition root.hh:14
void add(std::string completion, std::string description="") override
Definition args.cc:43
std::string Path
Definition types.hh:22