to-base supports parsing SRI hashes, so make type flag optional

This commit is contained in:
John Ericson 2020-06-02 18:05:26 +00:00
parent d73dbc8e4c
commit c502119fd3

View file

@ -79,12 +79,12 @@ static RegisterCommand r2("hash-path", [](){ return make_ref<CmdHash>(FileIngest
struct CmdToBase : Command
{
Base base;
HashType ht;
std::optional<HashType> ht;
std::vector<std::string> args;
CmdToBase(Base base) : base(base)
{
addFlag(Flag::mkHashTypeFlag("type", &ht));
addFlag(Flag::mkHashTypeFlag("type", &*ht));
expectArgs("strings", &args);
}