1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

Shell: Allow * and ? wildcard expansion in arguments

Should also presumably allow for escaping and such, but this is a start.
Fixes #112.
This commit is contained in:
Robin Burchell 2019-05-26 20:36:16 +02:00 committed by Andreas Kling
parent 4040c6137d
commit 9947ee9566
3 changed files with 115 additions and 2 deletions

View file

@ -61,7 +61,13 @@ public:
{
}
enum class CaseSensitivity {
CaseInsensitive,
CaseSensitive,
};
static String repeated(char, int count);
bool matches(const String& pattern, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
int to_int(bool& ok) const;
unsigned to_uint(bool& ok) const;
@ -136,6 +142,7 @@ public:
StringView view() const { return { characters(), length() }; }
private:
bool match_helper(const String& mask) const;
RetainPtr<StringImpl> m_impl;
};