networkctl: return error or warning when interfaces are not matched
We'd just print nothing and exit with 0. If the user gave an explicit name, we should fail. If a pattern didn't match, we should at least warn. $ networkctl status enx54ee75cb1dc0a* --no-pager && echo $? No interfaces matched. 0 $ networkctl status enx54ee75cb1dc0a --no-pager Interface "enx54ee75cb1dc0a" not found. 1
This commit is contained in:
+4
-1
@@ -177,7 +177,10 @@ void strv_print(char * const *l);
|
||||
char **strv_reverse(char **l);
|
||||
char **strv_shell_escape(char **l, const char *bad);
|
||||
|
||||
bool strv_fnmatch(char* const* patterns, const char *s, int flags);
|
||||
bool strv_fnmatch_full(char* const* patterns, const char *s, int flags, size_t *matched_pos);
|
||||
static inline bool strv_fnmatch(char* const* patterns, const char *s, int flags) {
|
||||
return strv_fnmatch_full(patterns, s, flags, NULL);
|
||||
}
|
||||
|
||||
static inline bool strv_fnmatch_or_empty(char* const* patterns, const char *s, int flags) {
|
||||
assert(s);
|
||||
|
||||
Reference in New Issue
Block a user