aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/args.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-17 19:31:06 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-17 19:31:06 +0000
commit801e6d96d878c3752048006b3a3c284b09a4c092 (patch)
treef9f05cc068effb83485bfaad33a4d8c4474c8209 /src/libutil/args.hh
parent2c9a8e7421408b1c98b04f258540749bb4f686e1 (diff)
parentd334fd48824b41b57e267cd2926fa9619b7718e3 (diff)
Merge commit 'd334fd48824b41b57e267cd2926fa9619b7718e3' into auto-uid-allocation
Diffstat (limited to 'src/libutil/args.hh')
-rw-r--r--src/libutil/args.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libutil/args.hh b/src/libutil/args.hh
index f41242e17..26f1bc11b 100644
--- a/src/libutil/args.hh
+++ b/src/libutil/args.hh
@@ -283,7 +283,17 @@ typedef std::vector<std::pair<std::string, std::string>> Table2;
void printTable(std::ostream & out, const Table2 & table);
-extern std::shared_ptr<std::set<std::string>> completions;
+struct Completion {
+ std::string completion;
+ std::string description;
+
+ bool operator<(const Completion & other) const;
+};
+class Completions : public std::set<Completion> {
+public:
+ void add(std::string completion, std::string description = "");
+};
+extern std::shared_ptr<Completions> completions;
extern bool pathCompletions;
std::optional<std::string> needsCompletion(std::string_view s);