We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e125839 commit efe2e94Copy full SHA for efe2e94
1 file changed
MAVProxy/tools/MAVExplorer.py
@@ -1177,6 +1177,18 @@ def cmd_file(args):
1177
print("%s (length %u)" % (n, len(files[n])))
1178
return
1179
fname = args[0]
1180
+ if any(c in fname for c in '*?['):
1181
+ # wildcard: extract all matching files to a directory (default cwd)
1182
+ matches = sorted(n for n in files if fnmatch.fnmatch(n, fname))
1183
+ if not matches:
1184
+ print("No files match %s" % fname)
1185
+ return
1186
+ destdir = args[1] if len(args) > 1 else '.'
1187
+ for n in matches:
1188
+ dest = os.path.join(destdir, os.path.basename(n))
1189
+ open(dest, "wb").write(files[n])
1190
+ print("Saved %s to %s" % (n, dest))
1191
1192
if not fname in files:
1193
print("File %s not found" % fname)
1194
0 commit comments