File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ tex2pdf*
1111.coverage
1212.idea
1313.vscode
14- 02_crowsnest /crowsnest.py
151403_picnic /picnic.py
161504_jump_the_five /jump.py
171605_howler /howler.py
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ """
3+ Author : Jeffrey Schmid-Paz
4+ Date : 2023-01-02
5+ Purpose: Warn captain for a something near the ship
6+ """
7+
8+ import argparse
9+
10+
11+ # --------------------------------------------------
12+ def get_args ():
13+ """Get command-line arguments"""
14+
15+ parser = argparse .ArgumentParser (
16+ description = "Crow's Nest -- choose the correct article" ,
17+ formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
18+ )
19+
20+ parser .add_argument ("word" , metavar = "word" , help = "A word" )
21+
22+ return parser .parse_args ()
23+
24+
25+ # --------------------------------------------------
26+ def main ():
27+ """Run the program"""
28+
29+ args = get_args ()
30+ pos_arg = args .positional
31+
32+ print (f'positional = "{ pos_arg } "' )
33+
34+
35+ # --------------------------------------------------
36+ if __name__ == "__main__" :
37+ main ()
You can’t perform that action at this time.
0 commit comments