Skip to content

Commit c3daaf0

Browse files
PathComplete tests: showcase new globbing functionality
1 parent 08c9ed6 commit c3daaf0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/pathcomplete.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212

1313
def get_main_parser():
1414
parser = argparse.ArgumentParser(prog="pathcomplete")
15-
shtab.add_argument_to(parser, ["-s", "--print-completion"]) # magic!
15+
shtab.add_argument_to(parser, ["-s", "--print-completion"]) # magic!
1616

1717
# file & directory tab complete
18-
parser.add_argument("file", nargs="?").complete = shtab.FILE
18+
parser.add_argument("file_all", nargs="?").complete = shtab.FILE
19+
parser.add_argument("file_md", nargs="?").complete = shtab.fglob('*.md')
1920
parser.add_argument("--dir", default=".").complete = shtab.DIRECTORY
2021
return parser
2122

0 commit comments

Comments
 (0)