Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions couchbase/get_options.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ struct get_options : public common_options<get_options> {
const std::vector<std::string> projections;
};

static constexpr std::size_t maximum_number_of_projections{ 16U };

/**
* Validates options and returns them as an immutable value.
*
Expand All @@ -60,10 +58,7 @@ struct get_options : public common_options<get_options> {
*/
[[nodiscard]] auto build() const -> built
{
if (projections_.size() + (with_expiry_ ? 2 : 1) < maximum_number_of_projections) {
return { build_common_options(), with_expiry_, projections_ };
}
return { build_common_options(), with_expiry_, {} };
return { build_common_options(), with_expiry_, projections_ };
}

/**
Expand Down
8 changes: 3 additions & 5 deletions tools/get.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ class get_app : public CLI::App
inlined_keyspace_,
"Extract bucket, scope, collection and key from the IDs (captures will be done with /^(.*?):(.*?)\\.(.*?):(.*)$/).");
add_flag("--with-expiry", with_expiry_, "Return document expiry time, if set.");
add_option(
"--project",
projections_,
fmt::format("Return only part of the document, that corresponds given JSON-pointer (could be used multiple times, up to {}).",
couchbase::get_options::maximum_number_of_projections))
add_option("--project",
projections_,
fmt::format("Return only part of the document, that corresponds given JSON-pointer (could be used multiple times)."))
->allow_extra_args(false);
add_flag("--hexdump", hexdump_, "Print value using hexdump encoding (safe for binary data on STDOUT).");
add_flag("--pretty-json", pretty_json_, "Try to pretty-print as JSON value (prints AS-IS if the document is not a JSON).");
Expand Down